We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Here’s another weird thing I’ve noticed while cleaning out cruft from a Revo 2.0.8 site:

    I deleted templates that weren’t being used, e.g. template #6. Then I’m going through the TVs to see if any of them aren’t being used, so I run a MySQL query like this:
    mysql> SELECT * FROM modx_site_tmplvar_templates WHERE tmplvarid=9;


    And the darndest thing... I get results that INCLUDE the template I just deleted, e.g.

    +-----------+------------+------+
    | tmplvarid | templateid | rank |
    +-----------+------------+------+
    |         9 |          6 |    0 |
    +-----------+------------+------+
    2 rows in set (0.00 sec)


    I would think that deleting the parent template should have caused all associated rows in modx_site_tmplvar_templates to be deleted. Is this a bug? It seems like the association between those two tables isn’t defined correctly in the xPDO schema. Is that possible? Or is this expected behavior?

    Thanks!
      • 6228
      • 249 Posts
      Well I may swimming with sharks, but the modTemplateVarTemplate class as defined in the mysql schema has a composite primary key, and I think I read somewhere that composite keys can cause trouble with relationships (sounds almost like my marriage) grin
        lo9on.com

        MODx Evolution/Revolution | Remote Desktop Training | Development
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Well, I went ahead and filed it as a bug -- I didn’t see anything on file for this (maybe there were previous tickets that were closed):

        http://bugs.modx.com/issues/4394