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

PHP warnings when using a progress bar with non-integer output_buffering setting.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.2
    • 3.1.1
    • Other
    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-55385_master
    • Hide

      This is easiest to test on a non-Windows server, since Windows can sometimes do odd stuff with output buffering

      1. Edit your php.ini to set output_buffering = Off and restart your webserver
      2. Perform a backup of a course.
      • Ensure there are no PHP warnings shown on the "Perform backup" screen
      1. Edit your php.ini to set output_buffering = On and repeat the process
      2. Edit your php.ini to set output_buffering = 4096 and repeat the process
      Show
      This is easiest to test on a non-Windows server, since Windows can sometimes do odd stuff with output buffering Edit your php.ini to set output_buffering = Off and restart your webserver Perform a backup of a course. Ensure there are no PHP warnings shown on the "Perform backup" screen Edit your php.ini to set output_buffering = On and repeat the process Edit your php.ini to set output_buffering = 4096 and repeat the process

      MDL-49324 updated the core\progress\display::update_progress() function to fill the output buffer using str_pad(), using the output buffer size defined in php.ini as the second argument to str_pad().

      However, the second argument of str_pad() must be and int, while valid values for output_buffering in php.ini include 'On' and 'Off'. If you use one of these values, you get the following warning when a progress bar is used:
      Warning: str_pad() expects parameter 2 to be long, string given in /path/to/moodle/lib/classes/progress/display.php on line 132

      Steps to reproduce:

      1. Set output_buffering to 'Off' in php.ini
      2. Do something that displays a progress base (e.g. making a course backup)
      3. The above Warning will be displayed when the progress bar updates.

            marxjohnson Mark Johnson
            marxjohnson Mark Johnson
            Sam Marshall Sam Marshall
            David Monllaó David Monllaó
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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