Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18787

eZDebug::printReport() with $returnReport = true still prints output

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.5.0
    • Misc
    • None
    • Operating System: Ubuntu Server / Linux
      PHP Version: 5.2.4-2ubuntu5.17

    Description

      I was trying to get the HTML for a debug report (to return it with an AJAX call) by using:

      $report = eZDebug::printReport( false, true, true );
      

      But the Debug report is written to the output buffer instead of into the variable. This invalidates the JSON I'm trying to return.

      This is, because printReport() calls printReportInternal(). But there, instead of just passing $returnReport, it passes $returnReport & $newWindow. So if I don't want code for a new window, that parameter turns to false.

      Another bug is:

      Even when specifying $newWindow = true AND $returnReport =true, calling printReport() still prints some JavaScript code to the output buffer. This still destroys my AJAX answers.

      Steps to reproduce

      1. Create the following module:

      <?php
      
      eZDebug::writeDebug( 'Test message from debugtest' );
      
      echo 'BEGIN eZDebug::printReport<br />' . PHP_EOL;
      $report = eZDebug::printReport( false, true, true );
      echo 'END eZDebug::printReport<br />' . PHP_EOL;
      
      echo '<hr />';
      
      echo 'Report should go here:' . PHP_EOL;
      echo $report;
      
      echo '<hr />';
      
      ?>
      

      2. Check output between 'BEGIN eZDebug::printReport<br />' and 'END eZDebug::printReport<br />'.

      Attachments

        Activity

          People

            unknown unknown
            silver.mab silver.mab
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: