Technical resource
[M1] Wrong format… missing 0
We are seeing drastic increase in error reports from product pages, the following exception is printed on attempt to load product page: Wrong format... missing 0 in lib/Zend/Currency.php(186): Zend_Locale_Format::toNumber('0.
Note: Staged WordPress metadata was unavailable for this legacy route. The body is retained inside the native shell; verify every version, dependency and download before applying it.
We are seeing drastic increase in error reports from product pages, the following exception is printed on attempt to load product page:
Wrong format... missing 0
in lib/Zend/Currency.php(186): Zend_Locale_Format::toNumber('0.000000', Array)
or
PHP Fatal error: Uncaught exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'Unknown date format, neither date nor time in 'yyyy-MM-dd HH:mm:ss' found' in app/code/core/Mage/Core/Model/Config.php:1357
Cause
The error seems to be caused by CloudLinux bug in cPanel (ea-php or alt-php packages) in updates from April 27, 2020:ALTPHP-912: Fix “Unknown date format, neither date nor time” for Magento
The bug is fixed in updated alt-php and ea-php packages and also can be fixed by switching from use of iconv library to mbstring in Zend Locale.
Solution
Ask your host to install the most recent updates for ea-php or alt-php with ALTPHP-912 bug fixed.Alternatively, to switch from iconv library to mbstring you can create local override for Zend/Locale/Format.php and change all
iconv_* with mb_* functions there:
- check if local override for Zend/Locale/Format.php exists and create it if needed (skip this step otherwise):
$ ls -la app/code/local/Zend/Locale/Format.php ls: cannot access app/code/local/Zend/Locale/Format.php: No such file or directory $ mkdir -p app/code/local/Zend/Locale $ cp -a lib/Zend/Locale/Format.php app/code/local/Zend/Locale/
- edit app/code/local/Zend/Locale/Format.php replacing all
iconv_calls withmb_functions - clear compiled cache and Disable Magento Compiler
Note: We are seeing drastic increase in such error reports since April 27, 2020 after recent cPanel update. You are also may be interested in cache_dir “null” must be a directory error in backend
Comments
Archived discussion
replacing
iconv_strposwithmb_strposin lib/Zend/Locale/Format.php should help.Please make sure that you have no local overrides in app/code/local/Zend/Locale/Format.php and cleared compiler cache.