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
    I have created a Custom Resource Class (CRC) and I'm doing some custom Ext JS stuff in it... and something in it is interfering with my CreateProcessor... when I save my CRC, it always comes through as a standard "modDocument" instead of as my CRC. However, when I comment out my custom Javascript and create another instance of my CRC, it saves correctly with my custom class_key. What the heck could be going on in my Javascript that is preventing my processors from firing? I tried to copy the built-in MODX JS stuff for creating a resource, and that took a lot of time: that stuff is completely obscured and the docs are AWOL, but I dug out this stuff:

    $this->addJavascript($mgrUrl.'assets/modext/util/datetime.js');
    $this->addJavascript($mgrUrl.'assets/modext/widgets/element/modx.panel.tv.renders.js');
    $this->addJavascript($mgrUrl.'assets/modext/widgets/resource/modx.grid.resource.security.local.js');
    $this->addJavascript($mgrUrl.'assets/modext/widgets/resource/modx.panel.resource.tv.js');
    $this->addJavascript($mgrUrl.'assets/modext/widgets/resource/modx.panel.resource.js');
    $this->addJavascript($mgrUrl.'assets/modext/sections/resource/create.js');
    


    So I'm adding some code to that "standard" stuff. I've got it copied and I've replaced every instance of modDocument I can find, but still my processors are not firing. The best guess I have is something with the connector url, e.g.

            url: MODx.config.connectors_url+'resource/index.php'


    But I really don't know what to replace that with... Is that even the right thing to tweak? Anyone have any ideas?
      • 3749
      • 24,544 Posts
      The default class key is set to modDocument assets/modext/widgets/resource/modx.panel.resource.js', in the setup function.

      The class key used is passed in config.record.class_key, so you need to make sure you're setting that correctly somewhere (or at least not setting it incorrectly).

      Before wading into the code, make sure the class_key is set correctly for your CRCs in the Database.

        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