Magento – Call to a member function getBackend() on a non-object

adminerrormagento-1.7

Client is trying to setup promotions via the admin but when saving and applying the promotion the server logs the following error (admin return blank screen):

PHP Fatal error: Call to a member function getBackend() on a
non-object in /app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php
on line 855

Unable to find any info regarding this type of error, what may be causing it, or how to correct it.

Thanks for your help!

Best Answer

Use the following script to list product attributes with non-existant backend models:

umask(0);
require 'app/Mage.php';    
Mage::setIsDeveloperMode(true);
Mage::app('admin');

$entityType = Mage::getSingleton('eav/config')->getEntityType('catalog_product');
foreach ($entityType->getAttributeCollection() as $attribute) {
    if ($backendClass = $attribute->getBackendModel()) {
        try {
            class_exists(Mage::getConfig()->getModelClassName($backendClass), true);
        } catch (Exception $e) {
            echo "Not found the backend model {$backendClass} for product attribute {$attribute->getAttributeCode()}\n";
        }
    }
}