Closed nodiscc closed 11 months ago
Probably caused by the fix for https://github.com/php/php-src/issues/12282 which landed in PHP 8.2.12 and 8.1.25
Edit: https://github.com/php/php-src/issues/12561, it might still get fixed upstream, so let's wait.
We have update our php version to the lastest yesterday (8.2.12
) and the bug still provoke 500 in our production environment :
Uncaught PHP Exception IntlException: "datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR" at /var/www/web/vendor/symfony/form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php line 179
Concern line in Symfony core :
$intlDateFormatter = new \IntlDateFormatter(\Locale::getDefault(), $dateFormat, $timeFormat, $timezone, $calendar, $pattern ?? '');
With inputs :
input | value |
---|---|
calendar | 1 |
dateType | 2 |
locale | cz |
pattern | yyyy-MM-dd |
timeType | -1 |
timezone | Object DateTimeZone |
So it seems than "cz" locale is considerate as an invalid locale >< CZ is part of the Iana list of language : https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
Type: region
Subtag: CZ
Description: Czechia
Description: Czech Republic
Added: 2005-10-16
So... bug or misconfiguration of our app ?
The bug was introduced in PHP 8.2.12 - technically not a "bug" but .patch version upgrades should not break backwards compatibility, so the change will be reverted in PHP 8.2.13 and 8.1.26, see https://github.com/php/php-src/issues/12561.
The path of least resistance is to not upgrade to PHP 8.2.12 and wait for the next PHP release.
We pass our users from "cz" locale to "cs" and it works again. Thanx for your response.
The automatic test suite started failing for PHP 8.1 and 8.2 after https://github.com/shaarli/Shaarli/pull/2028 which is just a documentation update and doesn't touch dependencies or application code.
https://github.com/shaarli/Shaarli/actions/workflows/ci.yml