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

32 Bit PHP autoconverts analysable::MAX_TIME (9999999999) to double

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.6, 4.2.3
    • 3.9.9, 3.11.2, 3.11.11, 4.0, 4.0.5, 4.1
    • Analytics
    • PHP 7.4 32-Bit version

      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/analysable.php#L41

      defines a constant that is used in the user.php analysable here:
      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/user.php#L190-L192

      This again is used in the time splitting periodic class here
      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/local/time_splitting/periodic.php#L82-L84

      DateTimeImmutable needs an int timestamp to work. 32 Bit PHP can't handle the integer value 9999999999, so it converts it to float. This leads to the warning:

      PHP Warning: DateTimeImmutable::setTimestamp() expects parameter 1 to be integer, float given in /moodle/application/htdocs/moodle/moodle_stacks/analytics/classes/local/time_splitting/periodic.php on line 83

      Possible solution: Smaller value for timestamp?

            poggenpohlda Daniel Poggenpohl
            poggenpohlda Daniel Poggenpohl
            Andrew Lyons Andrew Lyons
            Huong Nguyen Huong Nguyen
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 55 minutes
                55m

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