1

The line $productAttribute->getSource() in app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php throws an error: Call to a member function getSource() on a non-object

This is the concerning function

foreach ($attributes as $attribute) { $productAttribute = $attribute->getProductAttribute(); $productAttribute->getSource(); $this->addColumn($productAttribute->getAttributeCode(), array( 'header' => $productAttribute->getFrontend()->getLabel(), 'index' => $productAttribute->getAttributeCode(), 'type' => $productAttribute->getSourceModel() ? 'options' : 'number', 'options' => $productAttribute->getSourceModel() ? $this->getOptions($attribute) : '' )); } 

I assume a certain attribute didn't get created and this is causing the issue. But how can I debug it, find out which attribute is causing the issue? I tried to var_dump $attributes and $productAttribute but that results in a blank page. Nothing in log files.

Thanks!

1 Answer 1

1

You can do the following:

foreach ($attributes as $attribute) { $productAttribute = $attribute->getProductAttribute(); if(!is_object($productAttribute)) Mage::log($productAttribute->getAttributeCode()); $productAttribute->getSource(); ... } 

And then check your log file to see which one is causing the error.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.