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

The setGregorianChange() error appears on the profile page when the Kyiv time zone is selected.

XMLWordPrintable

    • 1
    • Team Hedgehog 2023 Sprint 2.0, Team Hedgehog 2023 Sprint 2.1

      If the time zone Europe/Kyiv is set, the error "Exception - Call to a member function setGregorianChange() on null" appears when accessing the profile page of that user. It also happens with "America/Ciudad_Juarez". After changing to another time zone the error disappears.

      We use Rocky Linux 9.1 / PHP 8.0.27 / MariaDB 10.6

      ==== ==== ==== ==== ==== ====

      Important note: (see MDL-78151 for more information). Please carry it over future issues like this.

      1. PHP classes normally uses IANA's timezone database that is updated with the timezonedb PHP extension (available via PECL).
      2. The Intl classes, that are a wrapper over ICU libraries, use their own timezone information, that is generated using IANA's as source, but different from it.
      3. Normally you can have actual IANA's timezones but outdated ICU's timezones (from when the PHP binaries were compiled or the ICU libraries imported.
      4. That makes problems like MDL-78151 to happen, where a timezone that is perfectly valid (because it's in the IANA's timezones but not in the ICU's one).
      5. To workaround that, each time that we add a new timezone to the lang strings we should, also, add a valid mapping within the core_date::strftime() method so, instead of using a timezone that still is not available, uses some pre-existing one, known to work.

      Also, if you want to ensure that your system is using updated ICU's timezones, this link may be useful:

      Note that some OS bundle both IANA's and ICU's timezone databases within their "tzdata" package (Ubuntu, ...) so the files may be already in the system, but others don't (Debian, ....).

      Files for all ICU's timezone databases can be found in the following link, and the ICU_TIMEZONE_FILES_DIR can be used to tell to ICU's libraries where to find them:

      Finally, to be sure about the timezone database versions being used in your PHP environments, you can use these commands:

      • IANA's (from php-timezonedb extension or from system):
        php -r 'var_dump(timezone_version_get());'
      • ICU's (from php-intl extension or from system):
        php -r "var_dump(IntlTimeZone::getTZDataVersion());"

            pholden Paul Holden
            Lyle Sam
            Huong Nguyen Huong Nguyen
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 25 minutes
                2h 25m

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