We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20366
    • 20 Posts
    Hi there,
    on MODX Revolution 2.4, I've extended a getResources-news-list by a getPage-pagination as described here: https://rtfm.modx.com/extras/revo/getpage

    Because I didn't need the first and last control element of getPage, I wanted to override the pageNavOuterTpl.

    As mentioned on the referring manual page, I created a property set for getPage and added a property called pageNavOuterTpl:
    [[+prev]][[+pages]][[+next]]
    This worked fine - for the moment.

    I was very astonished, when "First" and "Last" were suddenly reborn. I checked the property and noticed, that it was deleted after a couple of minutes. I repeated the procedure above. Everything worked fine at the beginning... But after a short while, the property was gone.

    I've checked the database. After I've created the property the database looks as follows:

    Table modx_element_property_sets contains the row:
    element: 68
    element_class: modSnippet
    property_set: 2

    Table modx_property_sets contains the row:
    id: 2
    name: newsListPagination
    category: 0
    description: Pagination
    properties: a:1:{s:15:"pageNavOuterTpl";a:7:{s:4:"name";s:15:"pageNavOuterTpl";s:4:"desc";s:0:"";s:4:"type";s:9:"textfield";s:7:"options";a:0:{}s:5:"value";s:28:"[[+prev]][[+pages]][[+next]]";s:7:"lexicon";N;s:4:"area";s:0:"";}}
    

    ...which is great and works fine.

    But after a little while, the above mentioned row of table modx_property_sets changes to:
    id: 2
    name: newsListPagination
    category: 0
    description: Pagination
    properties: a:0:{}

    I've unsuccessfully tried to reproduce this behaviour e. g. by flushing the cache or saving the snippet properties again. It seems, that the value is deleted arbitrary.

    Does anybody know, why this happens? Every help is appreciated.

    Cheers and thank you in advance,
    Chris.

    This question has been answered by mr.odo. See the first response.

      • 3749
      • 24,544 Posts
      Are you maybe clicking on "Save Property Set" without selecting the property set in the drop-down on the Properties tab of the Create/Edit snippet panel? That might save the default properties to the property set, which would empty it.

      Clicking on "Revert All to Default" when editing the property set would also explain it.

      It sounds like the default properties are being saved as your property set. Since there are no differences, the property set's properties are empty.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 20366
        • 20 Posts
        Howdy BobRay,
        thx for the quick reply!

        Quote from: BobRay at Aug 27, 2015, 05:33 PM
        Are you maybe clicking on "Save Property Set" without selecting the property set in the drop-down on the Properties tab of the Create/Edit snippet panel? That might save the default properties to the property set, which would empty it.

        Clicking on "Revert All to Default" when editing the property set would also explain it.

        Because this point was mentioned in an older bug, I took care not to do so.

        Saving the property, saving the property set, clearing the cache etc. doesn't affect my custom property immediately. It remains for a little while at the right place in the properties tab with green colour and my settings. For this period, it stays in the database and the snippet's output is OK. Then, I'm doing nothing and properties is replaced by a:0:{}.

        Quote from: BobRay at Aug 27, 2015, 05:33 PM
        It sounds like the default properties are being saved as your property set. Since there are no differences, the property set's properties are empty.

        Hmmm, I've created a new property set and the value for properties is NULL. I guess, the default wouldn't be an empty array a:0:{}.

        It seems to me, that some kind of garbage collection is sweeping the setting away.

        BTW: Thank you for your great MODX manual.
          • 36788
          • 75 Posts
          Are you using modx 2.4? This is the known bug of a new version.

          Here is the bug report and bugfix https://github.com/modxcms/revolution/issues/12580
            • 20366
            • 20 Posts
            Quote from: sladdals at Aug 27, 2015, 07:13 PM
            Are you using modx 2.4? This is the known bug of a new version.

            Here is the bug report and bugfix https://github.com/modxcms/revolution/issues/12580

            Thx a lot for your help, sladdals! Yes, that was the bug and the fix helps me for the moment.

            From my perspective, this bugfix is more a hotfix. It completely changes the behaviour of saving properties and sets. Before (I've tested it on Revo 2.3.3), only the changed properties were saved. Now, all properties are copied from the standard set, and the changed ones are merged into this set.

            So, thx to Fi1osof for his work and again to sladdals for the hint.

            Does anybody know, where official MODX bugfixes are announced (esp. this one wink )? [ed. note: mr.odo last edited this post 8 years, 6 months ago.]
              • 20366
              • 20 Posts
              MODX Revolution 2.4.1—Updates & Fixes
              The latest release of MODX Revolution is a patch upgrade to 2.4.1. If you missed the 2.4.0 announcement, get the low-down here. Lots of goodies.

              Obviously, property sets are no goodies.

              2.4.1 ships 1:1 Fi1osof's version/patch of core/model/modx/processors/element/propertyset/updatefromelement.class.php but it's not working any more. Also with mrhaw's fork of Fi1osof's patch the first property set is deleted, if something is saved. Both patches worked for my 2.4-projects.

              Any help is appreciated, if I'm doing something wrong. If not, I wouldn't recommend an update to 2.4.1, if property sets are used.

              May I point to opengeek's comment at the end of https://github.com/modxcms/revolution/issues/12580#event-420163270
              opengeek added this to the v2.4.2-pl milestone 4 days ago
              https://github.com/modxcms/revolution/milestones/v2.4.2-pl
              [ed. note: mr.odo last edited this post 8 years, 6 months ago.]
              • discuss.answer
                • 20366
                • 20 Posts
                OK, 2.4.2 solves this issue, as it was announced in the changelog:
                MODX Revolution 2.4.2-pl (October 6, 2015)
                ====================================
                - Fix emptying property sets on element save [#12580]
                - Different tree styles for unpublished + hidemenu [#12699]
                - Add patch for ExtJS Drag & Drop issue [#12617]
                ...