-
Bug
-
Resolution: Fixed
-
Major
-
3.9.16, 3.11.9, 4.0.3, 4.1
-
MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
-
It seems that latest versions of PHP come with a version of IANA database (TZDB) time zones version 2022b that includes the change of Europe/Kiev to Europe/Kyiv (note the old name still remains as alias).
This PHP Bug confirms it: https://bugs.php.net/bug.php?id=80254
And this is the failure that we are getting when using the latest PHP versions using that time zones database:
Example run, using just released 8.0.23 (September 1st): https://github.com/stronk7/moodle/actions/runs/2979120020
1) core_date_testcase::test_timezone_lang_strings
|
String for timezone europe/kyiv not found.
|
Failed asserting that false is true.
|
|
D:\a\moodle\moodle\lib\tests\date_test.php:174
|
D:\a\moodle\moodle\lib\phpunit\classes\advanced_testcase.php:80
|
So this issue is about to add that new Europe/Kyiv in all supported versions.
As a reference, MDL-72953 was exactly the same case. Trivial to fix, it seems, just add the new string.
Ciao
==== ==== ==== ==== ==== ====
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