We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    I’ve raised a bug on the Tracker (FS#942).

    I need to update 200+ documents with a new template and new template variable.
    On updating however, the template variables don’t get changed, and remain at the old values.

    EDIT: Just found out, this is because the Site Cache wasn’t cleared - despite DocManager saying "the site cache has automatically been cleared" after updating. huh
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 22629
      • 194 Posts
      There was another problem in DocManager with TV updates.

      Namely - if a document had a TV value set that was different to the default, and you wanted to reset it to the default, DocManager wouldn’t update it (it’d exclude the TV from the update because the value you supplied was the default value.)

      Please see Bug #942 to which I’ve attached a patch (and patched source file) which appears to fix this issue.

      What the patch does is this:


      • Now checks each TV against each document (instead of the template)
      • If the new value given for a TV matches the TV’s default value, it checks if the document had a previously-assigned value for the TV
      • If it did, it removes this value from the site_tmplvar_contentvalues table (resetting this document’s TV to the default)
      • If it didn’t, it’s ignored - nothing changes
      • If the new value given for a TV does not match the TV’s default value, the TV is updated as normal

      Hope this makes sense - the code in the patch is commented.
      MODx developers - can you test the patch and possibly include in the 0.9.6.1 patch release?

      Thanks.
        Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

        modx Revolution 2.2.6
        Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

        Content-Managed Websites Built on MODX
        • 10487 MODX Staff
        • 1,535 Posts
        Thanks Andy! smiley

        I will check out the patches over the weekend and get them committed if they work okay (which I’m sure they will). Should be in for the 0.9.6.1 release.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com