Created
January 16, 2015 21:55
-
-
Save markshust/9b7de35cb5291073d59d to your computer and use it in GitHub Desktop.
Fatal error: Call to a member function toOptionArray() on a non-object in magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php | |
| index 09fe084..b834f11 100644 | |
| --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php | |
| +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php | |
| @@ -460,7 +460,11 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge | |
| } | |
| } | |
| } else { | |
| - $optionArray = $sourceModel->toOptionArray($fieldType == 'multiselect'); | |
| + if (is_object($sourceModel)) { | |
| + $optionArray = $sourceModel->toOptionArray($fieldType == 'multiselect'); | |
| + } else { | |
| + Zend_Debug::dump($element);die(); | |
| + } | |
| } | |
| $field->setValues($optionArray); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment