Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Field “is_active” on Customer, won’t save with external custom code…
 
intellect_labs
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-10-28
West Haven, UT
 

This code doesn’t appear to work:

<?php
require_once('../app/Mage.php');
Mage::app("default");

$cust Mage::getModel('customer/customer')->load(2); // valid customer, me
$cust->setIsActive(false);
// $cust->setData('is_active',0);
// $cust->setIsActive(0);
// $cust->setIsActive('0');
$cust->save();

?>

Any ideas as to why that might be?  Note the additional methods I’ve tried.
 
Magento Community Magento Community
Magento Community
Magento Community
 
lefrancaiz
Jr. Member
 
Total Posts:  13
Joined:  2008-04-01
 

Hi there,

Have you found a solution for this ? I’m having the exact same issue.  Very strange.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lefrancaiz
Jr. Member
 
Total Posts:  13
Joined:  2008-04-01
 

Answering my own question here just in case it helps anyone in the future.

It seems there is a bug in the file app/code/core/Mage/Customer/Model/Entity

The function _getDefaultAttributes() is missing the ‘is_active’ and so it is not saving properly.

It should be:

protected function _getDefaultAttributes()
    
{
        
return array(
            
'entity_type_id',
            
'attribute_set_id',
            
'created_at',
            
'updated_at',
            
'increment_id',
            
'store_id',
            
'website_id',
        
'is_active'
        
);
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top