![]() |
|
|||||||
| 代码交流 ASP,PHP,JSP等网站源代码下载与交流。 |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
IP: 218.2.66.237
|
|||
|
|||
|
After upgrading with latest magento version, I came across with the following error when I opened my product to edit or even add new product from scratch. I was also unable to search any product/item on my store. Here is the error what I got:
Fatal error: Call to a member function setAttribute() on a non-object in E:\wamp\www\upgrade\app\code\core\Mage\Eav\Model\Entity\Attribute\Abstract.php After a long time fighting with magento pawn I came through with following solution. On /app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php Line around 374, Find : $this->_source = Mage::getModel($this->getSourceModel()) ->setAttribute($this); Replace with: if(is_object(Mage::getModel($this->getSourceModel()))){ $this->_source = Mage::getModel($this->getSourceModel()) ->setAttribute($this); } And open file: /app/code/core/Mage/Adminhtml/Block/Widget/Form.php Line around 201/202: Find: $element->setValues($attribute->getSource()->getAllOptions(true, true)); Replace with: if(is_object($attribute->getSource())){ $element->setValues($attribute->getSource()->getAllOptions(true, true)); } And open file: /app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php Line around 142/144: Find: return $this->getAttribute()->getSource()->getAllOptions(); Replace with: if(is_object($this->getAttribute()->getSource())){ return $this->getAttribute()->getSource()->getAllOptions(); } Cheer up all done. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|