We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16182
    • 56 Posts
    I understand YAMS is supposed to copy over existing content to new multilingual fields when a template is marked as multilingual in the YAMS settings:

    copy over content from the document variables to newly created multilingual template variables for the default language
    However, for me it doesn’t do that. Not in version 1.0.5-beta and not in 1.1.7-alpha. The fields just remain empty.

    Also discussed here (to some extent): http://modxcms.com/forums/index.php/topic,42139.0.html
      • 16182
      • 56 Posts
      Ok, digging a bit deeper in version 1.1.7-alpha I believe this indeed is a bug based on an if clause on line 707 in file [tt]yams.module.inc.php[/tt] where it says:
      // Handle the default content for newly created template variables
      if ( $newlyCreatedTV )
      {
      

      followed by the action that copies the relevant content. However, you don’t want to copy this only for newly created TVs but also for newly associated TVs! In my case, I had one template already set to multilingual but another one not. When I enabled the other one, the TVs didn’t get created because they already existed. But they got newly associated.

      It’s rather straight forward to fix this by either taking away the if-clause (does that do any harm apart from reducing performance?) or introducing an OR statement for the new associations.
        • 16182
        • 56 Posts
        Attached an updated file [tt]yams.module.inc.php[/tt] for version 1.1.7-alpha that introduced a new boolean flag [tt]newlyAssociatedTV[/tt] to fix this issue.
          • 16182
          • 56 Posts
          Finally a suggestion: a switch could be helpful to allow automatic copying of the content also to the other (non-default) languages. I find this easier when translating.

          If anyone is interested, I might attempt a hack for this as well.
          • ow, please do.
            Auto-sync (or a manual copy content button) between the "MODx’s original content" and "YAMS’ lang content" is a highly requested feature here.
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 16182
              • 56 Posts
              These are two different things!

              • I suggested automatic copying of the original MODx content to not just the default language but also the other languages in order to make translation a bit easier. This should be rather straight forward to implement.
              • You suggest copying or syncing of the default language stuff back to the original MODx fields whenever there is a change. I looked at the code and feel that this is a bit more tricky to do. Very well possible, but from my limited understanding of YAMS just more effort.
              • not only like this?
                In MODx’s original fields, there is a new button:
                [>>] copy to [optional: en|es|de] fields

                In all YAMS’ content, there is this button:
                [<<] copy to original fields
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 22851
                  • 805 Posts
                  kongo09.

                  That’s brilliant! No-one has complained specifically about this bug but I have actually known about it for some time. It has been on my list of niggles to fix before releasing a new version. What we really need is a YAMS bug tracker - but unfortunately I wasn’t able to get any space for YAMS bugs on JIRA. I guess I could see if I can set one up on my own server sometime. In the meantime, I’ll do the simple thing and create a "known bugs" sticky topic.

                  I’ll take a look at the patch you provided and integrate it into the next version of YAMS.
                    YAMS: Yet Another Multilingual Solution for MODx
                    YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                    Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                    • 22851
                    • 805 Posts
                    Quote from: kongo09 at Dec 28, 2009, 11:17 AM

                    These are two different things!

                    • I suggested automatic copying of the original MODx content to not just the default language but also the other languages in order to make translation a bit easier. This should be rather straight forward to implement.
                    With regards to copying content, perhaps we need a form within the module interface that would allow copying of content between languages or between languages and the standard document variables whenever required. The form would be something like:

                    * Copy from (dropdown): document variables, language1, language2, ...
                    * Copy to (dropdown): document variables, language1, language2, ...
                    * Method (dropdown): always copy, only copy if ’to’ field is blank
                    * Copy (button)


                    • You suggest copying or syncing of the default language stuff back to the original MODx fields whenever there is a change. I looked at the code and feel that this is a bit more tricky to do. Very well possible, but from my limited understanding of YAMS just more effort.
                    This would be something that happened on document save. It’s probably not that difficult to implement actually. There is already an option to automatically synchronise the pagetitle document variable with the default language pagetitle... So, it would just require a loop of the same logic over the other fields and the addition of an option in the module interface to allow this functionality to be switched on/off. I’ll add it to the TO DO list.
                      YAMS: Yet Another Multilingual Solution for MODx
                      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.