We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33210
    • 4 Posts
    Hi there,

    I think I found a bug in the modx core class, but because I’m not really sure where to post this, I’ll just try here, maybe someone will take care of it ;P

    I tried to apply a property set to a plugin I’m building, but no setting would be transfered to the plugin. After looking at the "invokeEvent" method in the modx class, I got to the line:

    $this->event->propertySet= (($pspos = strpos($pluginPropset, ':')) > 1) ? substr($pluginPropset, $pspos + 1) : '';


    Where I think it sould be

    $this->event->propertySet= (($pspos = strpos($pluginPropset, ':')) > 0) ? substr($pluginPropset, $pspos + 1) : '';


    because, otherwise plugins with ids < 10 will not get their property set applied correctly.


    Hope someone can confirm this.
    Best regards!
      • 3749
      • 24,544 Posts
      I think that code is looking for the ’:’ at the beginning of the JSON string containing the properties. It doesn’t have anything to do with the property set ID that I can see. I can’t find where those are set. It’s possible that they have a prefix added somewhere that would make >1 work. You may be correct, however, that it’s a bug. I don’t see where the properties are used and I see that the invokeEvent() code section is due for refactoring.

      Please file it at http://bugs.modx.com, if you would, so it doesn’t fall through the cracks.
        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
        • 33210
        • 4 Posts
        filed it as a bug. (for it being the first time, I hope the form is correct ;P))



        I think that code is looking for the ’:’ at the beginning of the JSON string containing the properties.

        From my debuging I found that $pluginPropset is initially set to something like:

        %pluginid%:%propertysetname%

        And this is why I think it fails for plugin-ids with less than 2 digits.