We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Failed to associate template variable content_fr" with template number 3 .
    Failed to associate template variable content_de" with template number 3 .
    Failed to associate template variable content_en" with template number 3 .


    Which could be the cause of such errors, which occur when trying to switch a template to multilingual (in "Modules > YAMS > Multilingual templates")?

    I checked that the TVs for languages are available for the given template (which has id=3 in the templates table).
    YAMS language tabs are displayed, but empty, as the multilingual TV remain on the "General" tab.

    Thanks for your help.


    • MODx 1.0.15
    • Content of tables coming from a working multilingual MODx 1.0.3 site.

    This question has been answered by Jul. See the first response.

    • discuss.answer
      • 15001
      • 697 Posts
      Solved by downgrading ManagerManager to version 0.5.1-pl.

      For version ManagerManager 0.6.2, this thread provides a patch on Github.
      However, I could not make it work.
        • 9995
        • 1,613 Posts
        Did you do these 2 things below (see link) and is your mm_rules correct?
        plugin managermanager config is linking to mm_rules and mm_rules is correct with the important line on the bottom:
        require( $modx->config['base_path'] . 'assets/modules/yams/yams.mm_rules.inc.php' );

        I have no problems anymore in 1.0.15 when doing this.

          Evolution user, I like the back-end speed and simplicity smiley
          • 15001
          • 697 Posts
          @fourroses666: As long as I can remember, the mm_rules seemed correct and I had applied the patch on GitHub including declaring $mm_version variable as global like Ronef suggested. But I must admit I was tired and that I should try again when I'm quiet.

          Currently, the solution of using ManagerManager 0.5.1-pl is ok for me, but I may try the patch again with a future site.
            • 9995
            • 1,613 Posts
            Did you fix it? Haven't seen this reply lipsrsealed
              Evolution user, I like the back-end speed and simplicity smiley
              • 15001
              • 697 Posts
              What I can see is that this error can also occur with ManagerManager-0.5.1-pl when unpublishing a language. For some reason, multilingual TV from languages that are still published are duplicated (with same name), i.e. YAMS creates new TVs even if they already exist.

              For instance, assuming you have a trilingual website with English, French, German as languages. When unpublishing (Desactivating) German, new TVs for English and French are automatically created
              content_en (128) -   (content (en))
              content_en(11) - content_en
              content_fr (129) -   (content (fr))
              content_fr (12) - content_fr

              and the same with other TVs, like pagetitle_en/fr, a.s.o.

              This makes your YAMS site crash.

              In such a case the solution is to delete the wrongly created TVs with a SQL request in phpMyAdmin (or equivalent).
              First, look which id does the lastly created TV have:
              SELECT MAX(id) FROM `sdo_site_tmplvars`
              Which returns 130 for instance.
              Second, list all the last TVs and look which one is a duplicated TV:
              SELECT * FROM `sdo_site_tmplvars` WHERE id>90 ORDER BY id

              If the first duplicated TV is 117, apply:
              DELETE FROM `sdo_site_tmplvars` WHERE id>116 
              [ed. note: Jul last edited this post 6 years, 2 months ago.]