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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.2
    • Component/s: Other
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-55385_master

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Sep/16