Magento Forum

   
Getting Recoverable Error
 
jhaagmans
Jr. Member
 
Total Posts:  14
Joined:  2010-08-04
 

In Magento 1.4.2 we suddenly get this error in the checkout process:

Recoverable Error: Argument 1 passed to Mage_Customer_Model_Attribute_Data::factory() must be an instance of Mage_Customer_Model_Attribute, instance of Mage_Eav_Model_Entity_Attribute given, called in ****/app/code/core/Mage/Customer/Model/Form.php on line 288 and defined in ****/app/code/core/Mage/Customer/Model/Attribute/Data.php on line 59

It appears like the wrong object is retrieved and sent along, but how can that be? We haven’t changed anything.

EDIT: removed some lines containing domain info.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jhaagmans
Jr. Member
 
Total Posts:  14
Joined:  2010-08-04
 

I don\’t get it:

protected function _getAttributeDataModel(Mage_Eav_Model_Entity_Attribute $attribute)
    
{
        $dataModel 
Mage_Customer_Model_Attribute_Data::factory($attribute$this->getEntity());
        
$dataModel->setIsAjaxRequest($this->getIsAjaxRequest());

        return 
$dataModel;
    
}

while:

public static function factory(Mage_Customer_Model_Attribute $attributeMage_Core_Model_Abstract $entity)

How can that work? One wants $attribute to be a Mage_Eav_Model_Entity_Attribute, while it sends it to a method that wants it to be a Mage_Customer_Model_Attribute

 
Magento Community Magento Community
Magento Community
Magento Community
 
jhaagmans
Jr. Member
 
Total Posts:  14
Joined:  2010-08-04
 

I\’ve changed it to:

public static function factory($attributeMage_Core_Model_Abstract $entity)

in /app/code/core/Mage/Customer/Model/Attribute/Data.php (line 59)

which works, but it doesn\’t seem like the right solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
techgyani
Jr. Member
 
Total Posts:  2
Joined:  2012-04-05
 

Hi,

I also encountered this issue, when our store upgraded to magento CE 1.4.2. Whenever I edit and save the customer and this ajax request is made

https://example.com/index.php/admin/customer/validate/id/1/?isAjax=true

And I get the following response from it :

“ Recoverable Error: Argument 1 passed to Mage_Customer_Model_Attribute_Data::factory() must be an instance of Mage_Customer_Model_Attribute, instance of Mage_Eav_Model_Entity_Attribute given”

When I disable Amasty_Customerattr ( Customer Attributes ) module, problem gets fixed. 

Solution mentioned above works too, but I also agree with you that this is not the good solution.

Edit : Disabling developer mode in index.php fixed the problem.

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