Magento Forum

Call to a member function isStatic()
 
anthonypinnock
Jr. Member
 
Total Posts:  7
Joined:  2011-03-09
 

Can’t seem to solve this error message I’m getting from the server system log.

PHP Fatal error:  Call to a member function isStatic() on a non-object in /chroot/home/fbbdevco/factorybunkbeds.com/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 430

I could not recreate the error myself. This is a standard installation module and the code seems solid. Has anyone encountered this issue or be able to give me some advice on solving this problem. The error occurs frequently but never when I’m surfing the site.

This is line 430.

if ($joinType !== false && !$this->getEntity()->getAttribute($attribute)->isStatic()) {

This is the entire function it’s in.

/**
     * Add attribute to entities in collection
     *
     * If $attribute=='*' select all attributes
     *
     * @param   array|string|integer|Mage_Core_Model_Config_Element $attribute
     * @param   false|string $joinType flag for joining attribute
     * @return  Mage_Eav_Model_Entity_Collection_Abstract
     */
    public function addAttributeToSelect($attribute$joinType false)
    
{
        
if (is_array($attribute)) {
            Mage
::getSingleton('eav/config')->loadCollectionAttributes($this->getEntity()->getType(), $attribute);
            foreach (
$attribute as $a{
                $this
->addAttributeToSelect($a$joinType);
            
}
            
return $this;
        
}
        
if ($joinType !== false && !$this->getEntity()->getAttribute($attribute)->isStatic()) {
            $this
->_addAttributeJoin($attribute$joinType);
        
elseif ('*' === $attribute{
            $attributes 
$this->getEntity()
                ->
loadAllAttributes()
                ->
getAttributesByCode();
            foreach (
$attributes as $attrCode=>$attr{
                $this
->_selectAttributes[$attrCode] $attr->getId();
            
}
        } 
else {
            
if (isset($this->_joinAttributes[$attribute])) {
                $attrInstance 
$this->_joinAttributes[$attribute]['attribute'];
            
else {
                $attrInstance 
Mage::getSingleton('eav/config')
                    ->
getCollectionAttribute($this->getEntity()->getType(), $attribute);
            
}
            
if (empty($attrInstance)) {
                
throw Mage::exception(
                    
'Mage_Eav',
                    
Mage::helper('eav')->__('Invalid attribute requested: %s', (string)$attribute)
                );
            
}
            $this
->_selectAttributes[$attrInstance->getAttributeCode()$attrInstance->getId();
        
}
        
return $this;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top