On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • 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 .

    Hello,

    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.

    Configuration

    • 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
      Solved by downgrading ManagerManager to version 0.5.1-pl.

      For version ManagerManager 0.6.2, this thread provides a patch on Github.
      http://forums.modx.com/thread/95259/bug-managermanager-6-2-not-workin-with-yams-anymore#dis-post-515733
      However, I could not make it work.
      • fourroses666 Reply #3, 4 years ago
        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.
        https://github.com/DivanDesign/MODXEvo.plugin.ManagerManager/issues/11#issuecomment-64813210


          Evolution user, I like the back-end speed and simplicity smiley
        • @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.
          • Did you fix it? Haven't seen this reply lipsrsealed
              Evolution user, I like the back-end speed and simplicity smiley
            • Nope.
              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 1 year, 5 months ago.]