0

This question already has an answer here:

After upgrading from 1.9 to 1.9.2 everything seems to be working fine but when I go to System>Configuration>Configurable Swatches I get the following error:

Fatal error: Call to a member function toOptionArray() on a non-object in app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463

I tried re-installing admin_html from magento connect but it didn't help and I am sure my theme supports configurable swatches because it's enabled on the demo. Any suggestions on how to solve this problem?

marked as duplicate by Fabian Schmengler, Adi, 7ochem, Rajeev K Tomy, Amit Bera Sep 22 '15 at 12:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Make sure that all the files are installed, and web server has enough privileges to actually load them. This could easily happens if install requires several steps. toOptionArray is a method from object that populates drop-down options. Referring to it as a non-object means that the object value is null, which usually happens when declaration file is either missing or not readable. Copy your file in local codepool and find this code:

$optionArray = $sourceModel->toOptionArray($fieldType == ‘multiselect’);

and replace it with:

if(is_object($sourceModel)){
$optionArray = $sourceModel->toOptionArray($fieldType == ‘multiselect’);
} else {
Mage::log($e->source_model);
}
  • Apparently the file Configattribute.php and select.php where create as folders and not files, deleted and re uploaded the files correctly and worked. – Artemis Chaitidis Sep 22 '15 at 12:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.