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

magento.stackexchange https://magento.stackexchange.com//questions/29486

  •  11-12-2019
  •  | 
  •  

Question

After installing "sphinx search ultimate", when I goto the config page and select the "sphinx search" panel, 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 464

I've tried some of the tips mentioned on the site here, including ensuring compilation is off.. but no luck.

Can someone help? Have you ever seen this issue when installing a new extension? Ideas on how to troubleshoot?

Thanks.

Was it helpful?

Solution

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.

OTHER TIPS

copy app\code\core\Mage\Adminhtml\Block\System\Config\Form.php

paste / extend to / create app\code\local\Mage\Adminhtml\Block\System\Config\Form.php

find the following on line 463

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

and replace it with:

if(is_object($sourceModel)){
   $optionArray = $sourceModel->toOptionArray($fieldType == 'multiselect');
} else {
   Mage::log($e->source_model);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top