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

PHP 8.0 compatibility: Configuration for recent files repository site admin page generates exception

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78544-401
    • MDL-78544-master
    • Hide
      1. Ensure you're using PHP 8 at a minimum for these tests.
      2. On a new site, go to Site admin > Plugins > Repositories > Recent Files
      3. Verify the page loads without any errors
      4. Set a time limit of 1 week and save
      5. Click "Settings" in the "Recent files" table row to edit the settings again
      6. Verify you see "1 weeks" set in the time limit field
      7. Uncheck the "Enabled" box next to the time limit and save
      8. Click "Settings" in the "Recent files" table row to edit the settings again
      9. Verify you the time limit field is not set (it should be disabled, and read "0 weeks")
      Show
      Ensure you're using PHP 8 at a minimum for these tests. On a new site, go to Site admin > Plugins > Repositories > Recent Files Verify the page loads without any errors Set a time limit of 1 week and save Click "Settings" in the "Recent files" table row to edit the settings again Verify you see "1 weeks" set in the time limit field Uncheck the "Enabled" box next to the time limit and save Click "Settings" in the "Recent files" table row to edit the settings again Verify you the time limit field is not set (it should be disabled, and read "0 weeks")
    • 1

      In a new install of of Moodle 4.2.1+ (Build: 20230616) with PHP 8.1 going to the "Configuration for recent files repository" site administration page generates the following exception:
      Exception - fmod(): Argument #1 ($num1) must be of type float, string given
      Debug info:
      Error code: generalexceptionmessage
      Stack trace:

      • line 164 of /lib/form/duration.php: TypeError thrown
      • line 164 of /lib/form/duration.php: call to fmod()
      • line 228 of /lib/form/duration.php: call to MoodleQuickForm_duration->seconds_to_unit()
      • line 439 of /lib/pear/HTML/QuickForm.php: call to MoodleQuickForm_duration->onQuickFormEvent()
      • line 485 of /lib/formslib.php: call to HTML_QuickForm->setDefaults()
      • line 3089 of /repository/lib.php: call to moodleform->set_data()
      • line 214 of /lib/formslib.php: call to repository_type_form->definition()
      • line 98 of /admin/repository.php: call to moodleform->__construct()

            jaked Jake Dallimore
            mspall Michael Spall
            Huong Nguyen Huong Nguyen
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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