-
Bug
-
Resolution: Fixed
-
Major
-
4.2
-
MOODLE_402_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-78151-401 -
-
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.
- PHP classes normally uses IANA's timezone database that is updated with the timezonedb PHP extension (available via PECL).
- 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.
- 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.
- That makes problems like
MDL-78151to happen, where a timezone that is perfectly valid (because it's in the IANA's timezones but not in the ICU's one). - 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());"
- has a non-specific relationship to
-
MDL-72953 String for timezone pacific/kanton not found
- Closed
-
MDL-75641 String for timezone europe/kyiv not found (tzdb 2022b)
- Closed
-
MDL-76674 String for timezone america/ciudad_juarez not found (tzdb 2022g)
- Closed
-
MDL-68760 PHPunit failures fromtest_timezone_lang_strings not helpful, and America/Nuuk string missing
- Closed
- is a regression caused by
-
MDL-75100 Migrate away from use of strftime and friends
- Closed