0

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.

Swetha
4961 gold badge6 silver badges24 bronze badges
asked Jul 20, 2014 at 7:26

2 Answers 2

2

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.

answered Jul 20, 2014 at 19:44
1
  • thanks. In the end, the extension makers sorted it out for me. Did seems to be a bad install or something. Commented Jul 21, 2014 at 17:49
4

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);
}
Andhi Irawan
9821 gold badge14 silver badges28 bronze badges
answered Feb 18, 2015 at 13:32
3
  • It's a bad practices to modifiy the core. Commented Jan 19, 2016 at 14:11
  • Hi @Nolwennig just paste / extend to / create app\code\local\Mage\Adminhtml\Block\System\Config\Form.php Commented Jul 19, 2016 at 4:10
  • Helps to get the issue. Thanks for the trick. Commented May 25, 2017 at 6:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.