We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Here is a neat trick for debugging plugins in MODX Revolution -- don’t know why I didn’t think of it sooner. Create a chunk called debug. Put code like this in your plugin:

    <?php // don't paste this line
    $chunk = $modx->getObject('modChunk', array('name'=>'debug'));
    /* Put any debugging information in the string, $s */
    $ids = $modx->getParentIds(58); // example function
    $s = 'Debug output' . "\n\n";
    $s .= print_r($ids,true);  // example debug output
    $chunk->setContent($s);
    $chunk->save();
    


    You can use Quick Update Chunk to view the debugging output, which will change each time the plugin executes.
      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