On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I have a plug-in script running in Revo 2.0.8 that modifies the document output. It is attached to the OnWebPagePrerender system event. The script works fine but the identical script with Revo 2.2.0 pl2 does not affect the output.

    I tried a simple script on both systems and got the same result, it works on 2.0.8 but not 2.2:
    $modx->documentOutput=$modx->documentOutput . 'test';

    On 2.2 I replaced the script with a call to write to the error log. That worked. So the plug-in is firing.

    Is there a new restriction on modifying document output with 2.2?
    • I can confirm this. It works on 'OnParseDocument' but not on 'OnWebPagePrerender'. Actually, the $modx->documentOutput was simply empty on OnWebPagePrerender as I remember.
        <em>The Earth is not the hell, and people aren't cursed, and joy in not a sin, but a gift of God.</em> (Lesia Ukrainka)
      • Try this:

        $output =& $modx->resource->_output
          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
        • Excellent, thanks Bob. To use my previous example this is how it would work:
          $modx->resource->_output = $modx->resource->_output . 'test';