Magento Forum

   
Customer creation date problem
 
lyassinel
Jr. Member
 
Total Posts:  1
Joined:  2009-03-08
 

Hi,

I have a problem with the customer management. If I edit the record of a customer and save, I have a creation date of the account “on Nov. 30 -1 00:00:00”. And if I try to edit the record, I get an error “There has-been an error processing your request.”
And in the report i get:

a:5:{i:0;s:25:"No date part in '' found.";i:1;s:4396:"#0 /homez.9/***/www/lib/Zend/Date.php(1078): Zend_Date->_calculate('set', false, NULL, 'fr_FR')
#1 /homez.9/***/www/lib/Zend/Date.php(197): Zend_Date->set(false, NULL, 'fr_FR')
#2 /homez.9/***/www/app/code/core/Mage/Core/Model/Locale.php(478): Zend_Date->__construct(false, NULL, Object(Zend_Locale))
#3 /homez.9/***/www/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php(76): Mage_Core_Model_Locale->date(false)
#4 /homez.9/***/www/app/design/adminhtml/default/default/template/customer/tab/view.phtml(36): Mage_Adminhtml_Block_Customer_Edit_Tab_View->getCreateDate()
#5 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(241): include('/homez.9/ikmkra...')
#6 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#7 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#8 /homez.9/***/www/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#9 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#10 /homez.9/***/www/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php(303): Mage_Core_Block_Abstract->toHtml()
#11 /homez.9/***/www/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 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(241): include('/homez.9/ikmkra...')
#13 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#14 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#15 /homez.9/***/www/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#16 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#17 /homez.9/***/www/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#18 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#19 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#20 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#21 /homez.9/***/www/app/design/adminhtml/default/default/template/page.phtml(58): Mage_Core_Block_Abstract->getChildHtml('left')
#22 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(241): include('/homez.9/ikmkra...')
#23 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#24 /homez.9/***/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#25 /homez.9/***/www/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#26 /homez.9/***/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#27 /homez.9/***/www/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#28 /homez.9/***/www/app/code/core/Mage/Core/Controller/Varien/Action.php(391): Mage_Core_Model_Layout->getOutput()
#29 /homez.9/***/www/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(151): Mage_Core_Controller_Varien_Action->renderLayout()
#30 /homez.9/***/www/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_CustomerController->editAction()
#31 /homez.9/***/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#32 /homez.9/***/www/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#33 /homez.9/***/www/app/code/core/Mage/Core/Model/App.php(347): Mage_Core_Controller_Varien_Front->dispatch()
#34 /homez.9/***/www/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#35 /homez.9/***/www/index.php(80): Mage::run('', 'store')
#36 {main}"
;s:3:"url";s:120:"/index.php/admin/admin/customer/edit/id/3/back/edit/tab/customer_info_tabs_account/key/b04fef379552e460454a9869eabc9b06/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Also the customer cannot acces to the front store login page.

Best regards.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Francesco2008
Member
 
Total Posts:  67
Joined:  2008-03-26
 

Hello,

I\’m having exactly the same issue....

Hiw have you solved, please?

Thanks
Francesco

 
Magento Community Magento Community
Magento Community
Magento Community
 
RomJohnson
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-13
 

Same here ... i think it’s a core bug or html edit template bug :(

Someone have a fix or can tell us where to find source code lines witch creates customer edit page???

 
Magento Community Magento Community
Magento Community
Magento Community
 
ivn03
Member
 
Total Posts:  57
Joined:  2011-10-11
 

Hi there,

I have exactly the same problem now. Did any one get any kind of fix for this one?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ivn03
Member
 
Total Posts:  57
Joined:  2011-10-11
 

Hi

Found a partial solution in one of the forums. Make this change in your lib/Zend/Date.php

isset($parsed['year']) ? (1970 $parsed['year']) : 1970,
                            
false), $this->getUnixTimestamp(), false);

                    
catch (Zend_Locale_Exception $e{

/*-- fix BEGIN --*/

                        
if( !is_numeric$date ) ) {

                                $parsed 
date_parse$date . ( $locale != "" " " $locale "" ) );
                                if( 
$parsed === FALSE {
                                        $parsed 
= array( 'year' => 1970'month' => 1'day' => 1'hour' => 0'minute' => 0'second' => );
                                
}

                                
return $this->_assign$calc$this->mktime(
                                                
$parsed['hour'],
                                                
$parsed['minute'],
                                                
$parsed['second'],
                                                
$parsed['month'],
                                                
$parsed['day'],
                                                
$parsed['year']false ),
                                                
$this->getUnixTimestamp( ), false );

                        
else {

                                
#require_once 'Zend/Date/Exception.php';
                                
throw new Zend_Date_Exception$e->getMessage( ) , 0$e$date );
                        
}
/*-- fix END --*/

                    
}

                }

                
return $this->_assign($calc$date$this->getUnixTimestamp(), false);
                break;

This way you can edit your records created either from front end or back end. They get edited and saved fine. But still the date does not change from 30 Nov -1 01:00:00. Need to fix that now. But hopefully this might help someone !

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom0
Jr. Member
 
Total Posts:  7
Joined:  2011-11-01
 

I came across this thread while having a very similar problem. The issue was/is caused by locale and the created_at field in the customers table. When editing a customer it does not filter the created_at date into a format acceptable by the database and so trashes it, causing this error.

I have fixed this by hacking the core (I like to adhere to best practises wink) Ive detailed my hack here:

http://stackoverflow.com/questions/8505003/get-error-while-editing-customers-from-back-end-in-magento/8620783#8620783

Its basically just adding 1 line of code to ensure the created_at date gets filtered.

I think this is a bug in Magento, but I would love to get this confirmed by someone.

ps. I have also posted this message on this thread: http://www.magentocommerce.com/boards/viewthread/237173/
Sorry about the duplication.. hoping it might help someone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ivn03
Member
 
Total Posts:  57
Joined:  2011-10-11
 

@Tom0

In your link, you haven’t mention exactly where the edit needs to be made. It would be great if you could specify which file exactly needs this change/edit ?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
robertus
Jr. Member
 
Total Posts:  1
Joined:  2010-12-06
 

Hi, i have the same problem , but only with one customer, suddenly this date appeared 30 nov. -1 01:00:00 , the new ones no problem,and i can stil make new custumers, i\\\’m not a programmer and since 2 months into magento could someone please explain what is the best way to do? i\\\’m afraid to make changes i had 1 crash already in the beginning and started all over, what about this answer in the other blog?

This is a problem with the backend_model used by this attribute. dob uses \\\"eav/entity_attribute_backend_datetime\\\" backend_model, and product is using \\\"eav/entity_attribute_backend_time_created\\\" but created_at for customer is not using it. This backend_model is handling all the conversion and filter dates, so, it is so simple as changing the \\\"eav_attribute\\\" table. Search for the attribute_code = \\\’created_at\\\’ AND entity_type_id = 1 and update the value of the backend_model from NULL to \\\"eav/entity_attribute_backend_time_created\\\" and that is. No core files needs to be changed.

If you prefer, you can use a Resource Setup to update this attribute from the installer of your own module.

do i have to change something in my phpadmin,sorry guys red face  maybe these are stupid question but i\\\’m just a beginner who\\\’s learning
thanks a lot in advance
by the way my site (vers 1.6.1.0) is running under ISS windows (www.montolieu.org) with rewrites enabled i\\\’ll have some questions about the htaccess as well but i\\\’ll do that in another topic.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ScottG
Member
 
Total Posts:  45
Joined:  2011-07-13
 

I would really like an answer to this as well.

If anyone knows a core hack I would be happy with that.

(At the moment when I edit a customer through Admin the “Created At” date is reset to 30/11/00-1 10:00:00 AM)

What I would really like is a hack to remove all admin saves from writing to this field altogether.

As I don’t see any reason at the moment why I would ever want to change the creation date of a customer I am quite happy to have that data ignored from the save (removed from the list of fields being updated in the database) rather than try to fix the date format.

My solution seems cleaner and more reliable that trying to deal with the date format.

Any help with this hack will be most appreciated

Regards
Scott

EDIT:
I have not supplied enough information:
After trying this on my test server ver. 1.6.1.0 it is OK, the ‘Created At’ field is not an editable field, and the save works just fine.
My problem is I am running Pro ver. 1.11.0.0 which does have this problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattlecount
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-05-19
 

Try this if you’re looking to make the field uneditable. I don’t think it was ever intended to be an editable field as it seems to be a typo in Account.php.

The file to change is:

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php

Replace:

if ($customer->getId()) {
            $form
->getElement('website_id')->setDisabled('disabled');
            
$form->getElement('created_in')->setDisabled('disabled');
        
else {
            $fieldset
->removeField('created_in');
        
}

With:

if ($customer->getId()) {
            $form
->getElement('website_id')->setDisabled('disabled');
            
$form->getElement('created_at')->setDisabled('disabled');
        
else {
            $fieldset
->removeField('created_at');
        
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Daniel Freitas
Jr. Member
 
Total Posts:  3
Joined:  2010-06-25
 

worked fine for me.

Tks.

mattlecount - 31 May 2012 07:29 AM

Try this if you’re looking to make the field uneditable. I don’t think it was ever intended to be an editable field as it seems to be a typo in Account.php.

The file to change is:

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php

Replace:

if ($customer->getId()) {
            $form
->getElement('website_id')->setDisabled('disabled');
            
$form->getElement('created_in')->setDisabled('disabled');
        
else {
            $fieldset
->removeField('created_in');
        
}

With:

if ($customer->getId()) {
            $form
->getElement('website_id')->setDisabled('disabled');
            
$form->getElement('created_at')->setDisabled('disabled');
        
else {
            $fieldset
->removeField('created_at');
        
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
choussamaster
Sr. Member
 
Total Posts:  93
Joined:  2009-07-14
 

/app/code/core/Mage/Adminhtml/controllers/CustomerController.php
public function saveAction()
{ ..............
$formData = $customerForm->extractData($this->getRequest(), ‘account’);
$formData = $this->_filterDates($formData, array(’created_at’)); /// add this line

 
Magento Community Magento Community
Magento Community
Magento Community
 
kevinstevens
Jr. Member
 
Total Posts:  1
Joined:  2012-01-22
 

I had a similar issue when importing customers from a csv file, as the UK date format was being used in the ‘created_at’ field. Changing the ‘created_at’ date format to a MySQL database format (YYYY-MM-DD HH:MM:SS) in Libre Office fixed it once I found this thread which highlighted the problem as a locale issue - thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top