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

Maintenance warning contains deprecated float to int cast on PHP 8.1

    XMLWordPrintable

Details

    Description

      Using the maintenance_warning() function on PHP 8.1 results in a deprecation notice being emitted for an int to float cast. The float value should be floored before the modulo operation which does the implicit cast.

      To replicate:
       - Debugging on

      • php /admin/cli/cfg.php --name=maintenance_later --set=<TIME + 300>
      • Visit gui and observe deprecation warning in DOM.

      Deprecated: Implicit conversion from float 1305.1166666666666 to int loses precision in /var/www/moodlecore/lib/outputrenderers.php on line 844

      Attachments

        Issue Links

          Activity

            People

              peterburnett Peter Burnett
              peterburnett Peter Burnett
              Matthew Hilton Matthew Hilton
              Andrew Lyons Andrew Lyons
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 31 minutes
                  31m

                  Clockify

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