cancel
Showing results for 
Search instead for 
Did you mean: 

Product Export Error

Product Export Error

Hi All,

 

I am trying to export products from my Magento 1.9.2 installation, however, each time I get this error:

 

Fatal error: Call to undefined method Mage_Adminhtml_Model_System_Config_Source_Yesno::setAttribute() in /app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php on line 389

 

I have checked the line number mentioned in the error:

 

public function getSource()
{
if (empty($this->_source)) {
if (!$this->getSourceModel()) {
$this->setSourceModel($this->_getDefaultSourceModel());
}
$source = Mage::getModel($this->getSourceModel());
if (!$source) {
throw Mage::exception('Mage_Eav',
Mage::helper('eav')->__('Source model "%s" not found for attribute "%s"',$this->getSourceModel(), $this->getAttributeCode())
);
}
$this->_source = $source->setAttribute($this);
}
return $this->_source;
}

 

I created a simple product with the Attributes & the Attribute Set that I required so as to download the same & use that as a template to import my product list.

 

I have checked all the custom attributes that I created, its still a no go, I have tried checking it on google & also on the forums, however, I am unable to resolve this issue.

 

I am not a developer, kindly guide me.

 

Thanks in advance.

1 REPLY

Re: Product Export Error

I guess the the error is thrown by an attribute, that you didn't add manually. It it most likely a attribute, installed by a worse module.

 

Technical background:
Mage_Adminhtml_Model_System_Config_Source_Yesno is not made to be an eav attribute source model, it doesn't extend Mage_Eav_Model_Entity_Attribute_Source_Abstract.

Anyway .. look in your database table eav_attribute and search for attributes with source_model = adminhtml/system_config_source_yesno:

 

 

SELECT 
    *
FROM
    `eav_attribute`
WHERE
    source_model = 'adminhtml/system_config_source_yesno';


I guess, you'll find at least one entry. Then replace it with a correct source model:

UPDATE eav_attribute 
SET 
    source_model = 'eav/entity_attribute_source_boolean'
WHERE
    source_model = 'adminhtml/system_config_source_yesno';


After this, your export should work without errors.

Best,
Peter