We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17667
    • 108 Posts
    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?
      • 33277
      • 35 Posts
      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)
        • 3749
        • 24,544 Posts
        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
          • 17667
          • 108 Posts
          Excellent, thanks Bob. To use my previous example this is how it would work:
          $modx->resource->_output = $modx->resource->_output . 'test';