Published: May 5, 2020
Last updated:

[M1] Wrong format… missing 0

Tags:

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 with mb_functions
  • clear compiled cache and Disable Magento Compiler
If it would not work due to some reason or you wish to have us handle it for you, please create a new ticket via our support form.

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


Posted in: Localization, Troubleshooting

23 votes, 4.60 avg. rating (91% score)