Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72582

readfile_accel() error handler may cause Object of class stored_file could not be converted to string

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.11.3
    • Files API
    • MOODLE_311_STABLE
    • Hide

      These instructions assume command-line access to working Moodle install.

      1. Place the testing script, test_readfile_accel.php, in the root of your Moodle install (e.g. /var/www/html)
      2. Run this command to execute the testing script, and discarding STDOUT: php test_readfile_accel.php 1>/dev/null
      3. Inspect the output (actually STDERR)
      4. Verify both lines of output are of the form: "Non-empty default output handler buffer detected..."
      Show
      These instructions assume command-line access to working Moodle install. Place the testing script, test_readfile_accel.php, in the root of your Moodle install (e.g. /var/www/html) Run this command to execute the testing script, and discarding STDOUT: php test_readfile_accel.php 1>/dev/null Inspect the output (actually STDERR) Verify both lines of output are of the form: "Non-empty default output handler buffer detected..."

      MDL-69355 introduced error handling to lib/filelib.php:readfile_accel():

       

                  if ($buffercontents !== '') {
                      error_log('Non-empty default output handler buffer detected while serving the file ' . $file);
                  }
      

       

      But $file can be either a string or a stored_file instance. If it's the latter then you'll get Object of class stored_file could not be converted to string.

            matt.rice Matt Rice
            leonstr Leon Stringer
            Simey Lameze Simey Lameze
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 54 minutes
                1h 54m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.