Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Warning: Invalid argument supplied for foreach() Observer.php on line 224 #200

Open
borriglione opened this issue Nov 8, 2013 · 0 comments

Comments

@borriglione
Copy link

In case meta_autogenerate is active, a warning occurs if no category was given.
There is no check before looping through empty category arrays.

exception 'Exception' with message 'Warning: Invalid argument supplied for foreach() in /home/shop/01/www/vendor/firegento/germansetup/src/app/code/community/FireGento/GermanSetup/Model/Observer.php on line 224' in /home/shop/01/www/app/code/core/Mage/Core/functions.php:245
Stack trace:
#0 /home/shop/01/www/vendor/firegento/germansetup/src/app/code/community/FireGento/GermanSetup/Model/Observer.php(224): mageCoreErrorHandler(2, 'Invalid argumen...', '/home/shop/...', 224, Array)
#1 /home/shop/01/www/vendor/firegento/germansetup/src/app/code/community/FireGento/GermanSetup/Model/Observer.php(161): FireGento_GermanSetup_Model_Observer->_buildKeywords(NULL)
#2 /home/shop/01/www/vendor/firegento/germansetup/src/app/code/community/FireGento/GermanSetup/Model/Observer.php(124): FireGento_GermanSetup_Model_Observer->_getCategoryKeywords(Object(Mage_Catalog_Model_Product))
#3 /home/shop/01/www/app/code/core/Mage/Core/Model/App.php(1338): FireGento_GermanSetup_Model_Observer->autogenerateMetaInformation(Object(Varien_Event_Observer))
#4 /home/shop/01/www/app/code/core/Mage/Core/Model/App.php(1311): Mage_Core_Model_App->_callObserverMethod(Object(FireGento_GermanSetup_Model_Observer), 'autogenerateMet...', Object(Varien_Event_Observer))
#5 /home/shop/01/www/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#6 /home/shop/01/www/app/code/core/Mage/Core/Model/Abstract.php(391): Mage::dispatchEvent('catalog_product...', Array)
#7 /home/shop/01/www/app/code/core/Mage/Catalog/Model/Abstract.php(315): Mage_Core_Model_Abstract->_beforeSave()
#8 /home/shop/01/www/app/code/core/Mage/Catalog/Model/Product.php(514): Mage_Catalog_Model_Abstract->_beforeSave()
#9 /home/shop/01/www/app/code/core/Mage/Core/Model/Abstract.php(316): Mage_Catalog_Model_Product->_beforeSave()
#10 /home/shop/01/www/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(714): Mage_Core_Model_Abstract->save()
#11 /home/shop/01/www/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Catalog_ProductController->saveAction()
#12 /home/shop/01/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#13 /home/shop/01/www/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /home/shop/01/www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 /home/shop/01/www/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#16 /home/shop/01/www/index.php(88): Mage::run('', 'store')

borriglione added a commit to borriglione/firegento-germansetup that referenced this issue Nov 11, 2013
…er to prevent warning during auto meta generation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants