cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal Error when accessing Google Api

Fatal Error when accessing Google Api

Hi guys,

 

I receive the following error when I try to access the Google API from system > configuration

 

Fatal error: Call to a member function toOptionArray() on boolean in /var/www/spillenoerd.dk/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463

 

Error log:

2015-06-04T13:05:19+00:00 ERR (3): Warning: include(Magmodules/Googleshopping/Model/Source/Accounttype.php) [<a href='http://php.net/manual/en/function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

2015-06-04T13:05:19+00:00 ERR (3): Warning: include(Magmodules/Googleshopping/Model/Source/Accounttype.php) [<a href='http://php.net/manual/en/function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

2015-06-04T13:05:19+00:00 ERR (3): Warning: include() [<a href='http://php.net/manual/en/function.include'>function.include</a>]: Failed opening 'Magmodules/Googleshopping/Model/Source/Accounttype.php' for inclusion (include_path='/var/www/spillenoerd.dk/public_html/app/code/local:/var/www/spillenoerd.dk/public_html/app/code/community:/var/www/spillenoerd.dk/public_html/app/code/core:/var/www/spillenoerd.dk/public_html/lib:.') in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

2015-06-04T13:05:35+00:00 ERR (3): Warning: include(Magmodules/Googleshopping/Model/Source/Accounttype.php) [<a href='http://php.net/manual/en/function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

2015-06-04T13:05:35+00:00 ERR (3): Warning: include(Magmodules/Googleshopping/Model/Source/Accounttype.php) [<a href='http://php.net/manual/en/function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

2015-06-04T13:05:35+00:00 ERR (3): Warning: include() [<a href='http://php.net/manual/en/function.include'>function.include</a>]: Failed opening 'Magmodules/Googleshopping/Model/Source/Accounttype.php' for inclusion (include_path='/var/www/spillenoerd.dk/public_html/app/code/local:/var/www/spillenoerd.dk/public_html/app/code/community:/var/www/spillenoerd.dk/public_html/app/code/core:/var/www/spillenoerd.dk/public_html/lib:.') in /var/www/spillenoerd.dk/public_html/lib/Varien/Autoload.php on line 94

 

Google usually helps, but I can't seem to find a solution for this problem.

 

I don't know what caused the error or when i happend. I running the newest version of Magento.

 

I'll appreciate any help I can get.

 

Lars

3 REPLIES

Re: Fatal Error when accessing Google Api

@spillnoerd

 

 

Go to app\code\core\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);
}
Found something useful, please give "Kudos" or "Accept as Solution" for Token of Appreciation.
Free Magento Extensions : https://magecomp.com/free-magento-extensions.html

Re: Fatal Error when accessing Google Api

Hi @theMageComp,

 

i've had the same error. but when i apply your sollution i get a magento error page. 

 

There has been an error processing your request

 

when i open the report, i see the following errors. 

do you have any idea what can be wrong? 

 

thnx!

 

a:5:{i:0;s:85:"Mage registry key "_singleton/googleshopping/source_destinationstates" already exists";i:1;s:2225:"#0 /home/admin/domains/moleculeclothing.eu/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/admin/domains/moleculeclothing.eu/public_html/app/Mage.php(477): Mage::register('_singleton/goog...', false)
#2 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(449): Mage::getSingleton('googleshopping/...')
#3 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#4 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(164): Mage_Adminhtml_Block_System_Config_Form->_initGroup(Object(Varien_Data_Form), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#5 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#6 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(107): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#7 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_System_ConfigController->editAction()
#8 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#9 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home/admin/domains/moleculeclothing.eu/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home/admin/domains/moleculeclothing.eu/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#12 /home/admin/domains/moleculeclothing.eu/public_html/index.php(87): Mage::run('', 'store')
#13 {main}";s:3:"url";s:94:"/index.php/admin/admin/system_config/edit/section/google/key/7c34ed8010a9f458023f4d898d612094/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

 

Re: Fatal Error when accessing Google Api

Still doesn't work Smiley Sad