Question

I have recently done an upgrade to a currently live and active Magento store from 1.9.0.x to 1.9.2.2 and when attempting to add a customer via the front end registration form or accessing customer edit in the admin area I receive the following PHP error:

No date part in '' found.

See:

a:5:{i:0;s:25:"No date part in '' found.";i:1;s:5013:"
#0 app/code/core/Zend/Date.php(1091): Zend_Date->_calculate('set', false, NULL, 'en_GB')
#1 app/code/core/Zend/Date.php(210): Zend_Date->set(false, NULL, 'en_GB')
#2 app/code/core/Mage/Core/Model/Locale.php(546): Zend_Date->__construct(false, NULL, Object(Zend_Locale))
#3 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php(91): Mage_Core_Model_Locale->storeDate('1', false, true)
#4 app/design/adminhtml/default/default/template/customer/tab/view.phtml(37): Mage_Adminhtml_Block_Customer_Edit_Tab_View->getStoreCreateDate()
#5 app/code/core/Mage/Core/Block/Template.php(241): include('/Users/chrisbra...')
#6 app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#7 app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#8 app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#9 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#10 app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php(303): Mage_Core_Block_Abstract->toHtml()
#11 app/design/adminhtml/default/default/template/widget/tabs.phtml(38): Mage_Adminhtml_Block_Widget_Tabs->getTabContent(Object(Mage_Adminhtml_Block_Customer_Edit_Tab_View))
#12 app/code/core/Mage/Core/Block/Template.php(241): include('/Users/chrisbra...')
#13 app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#14 app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#15 app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#16 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#17 app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#18 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#19 app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#20 app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#21 app/design/adminhtml/default/default/template/page.phtml(58): Mage_Core_Block_Abstract->getChildHtml('left')
#22 app/code/core/Mage/Core/Block/Template.php(241): include('/Users/chrisbra...')
#23 app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#24 app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#25 app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#26 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#27 app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#28 app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#29 app/code/core/Mage/Adminhtml/controllers/CustomerController.php(151): Mage_Core_Controller_Varien_Action->renderLayout()
#30 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_CustomerController->editAction()
#31 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#32 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#33 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#34 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#35 index.php(83): Mage::run('', 'store')
#36 {main}";s:3:"url";s:54:"/index.php/admin/customer/edit/id/14570/css/styles.css";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

How can I solve this by not modifying the core or loosing any current data?

Was it helpful?

Solution

I've just fixed an issue after this exact error happened to me. Not sure if it was an upgrade or not.

Regardless, it was because a big chunk of customers had customer_entity set to 0000-00-00 00:00:00 - which Magento really had trouble parsing.

Nevertheless, I ran the following SQL query and it fixed it:

(Obviously back it up)

UPDATE `customer_entity`
    SET created_at = "2014-01-01 09:00:00"
    WHERE created_at =  "0000-00-00 00:00:00"

Don't take this for granted. I set the date to at least a year before the site went live so as not to contradict with orders the customer may have made.

Hope that helps in some way :)

OTHER TIPS

File path : lib/Zend/Locale/Format.php

Replace below:

 $split = false;
    preg_match_all('/\d+/u', $number, $splitted);

    if (count($splitted[0]) == 0) {

With :

$split = false;
    preg_match_all('/\d+/u', $number, $splitted);


    if (!empty($number) && count($splitted[0]) == 0) {

I created a simple module which allows fixing the problem with all new customers on your Magento site.

Please read REAMDE.md for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top