Magento - 在第93行的Fulltext.php中为foreach()提供的参数无效

时间:2014-05-21 10:01:36

标签: magento exception magento-1.7

我正在尝试用安装Magento(v1.7.0.2)帮助一位朋友。

他无法更新任何CMS页面,并且异常日志始终显示上述错误。尝试重新索引页面时,也会发生同样的错误。

以下是尝试保存页面的日志:

2014-05-21T09:30:32+00:00 DEBUG (7): Exception message: Warning: Invalid argument supplied for foreach()  in /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php on line 93
Trace: #0 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php(93): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/wildgu...', 93, Array)
#1 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php(184): MageWorx_SearchAutocomplete_Model_Mysql4_Fulltext->_regenerateStoreIndex('1', '11')
#2 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Fulltext.php(40): MageWorx_SearchAutocomplete_Model_Mysql4_Fulltext->regenerateIndex(NULL, '11')
#3 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Observer.php(44): MageWorx_SearchAutocomplete_Model_Fulltext->regenerateIndex(NULL, '11')
#4 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(1338): MageWorx_SearchAutocomplete_Model_Observer->regenerateCmsPageIndex(Object(Varien_Event_Observer))
#5 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(MageWorx_SearchAutocomplete_Model_Observer), 'regenerateCmsPa...', Object(Varien_Event_Observer))
#6 /var/www/wildguitars.co.il/htdocs/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('cms_page_save_a...', Array)
#7 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/Abstract.php(466): Mage::dispatchEvent('cms_page_save_a...', Array)
#8 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Core_Model_Abstract->_afterSave()
#9 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php(150): Mage_Core_Model_Abstract->save()
#10 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Cms_PageController->saveAction()
#11 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#12 /var/www/wildguitars.co.il/htdocs/app/code/community/Mage/Core/Controller/Varien/Front.php(223): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/wildguitars.co.il/htdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /var/www/wildguitars.co.il/htdocs/index.php(87): Mage::run('', 'store')
#16 {main}

这是重建索引的日志:

2014-05-21T09:20:59+00:00 DEBUG (7): Exception message: Warning: Invalid argument supplied for foreach()  in /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php on line 93
Trace: #0 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php(93): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/wildgu...', 93, Array)
#1 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Mysql4/Fulltext.php(184): MageWorx_SearchAutocomplete_Model_Mysql4_Fulltext->_regenerateStoreIndex('1', NULL)
#2 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Fulltext.php(40): MageWorx_SearchAutocomplete_Model_Mysql4_Fulltext->regenerateIndex(NULL, NULL)
#3 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Observer.php(44): MageWorx_SearchAutocomplete_Model_Fulltext->regenerateIndex(NULL, NULL)
#4 /var/www/wildguitars.co.il/htdocs/app/code/local/MageWorx/SearchAutocomplete/Model/Observer.php(107): MageWorx_SearchAutocomplete_Model_Observer->regenerateCmsPageIndex(Object(Varien_Event_Observer))
#5 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(1338): MageWorx_SearchAutocomplete_Model_Observer->catalogsearchIndexProcessStart(Object(Varien_Event_Observer))
#6 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(MageWorx_SearchAutocomplete_Model_Observer), 'catalogsearchIn...', Object(Varien_Event_Observer))
#7 /var/www/wildguitars.co.il/htdocs/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalogsearch_i...', Array)
#8 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(82): Mage::dispatchEvent('catalogsearch_i...', Array)
#9 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php(446): Mage_CatalogSearch_Model_Fulltext->rebuildIndex()
#10 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Index/Model/Process.php(209): Mage_CatalogSearch_Model_Indexer_Fulltext->reindexAll()
#11 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#13 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#14 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#15 /var/www/wildguitars.co.il/htdocs/app/code/community/Mage/Core/Controller/Varien/Front.php(223): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /var/www/wildguitars.co.il/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 /var/www/wildguitars.co.il/htdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#18 /var/www/wildguitars.co.il/htdocs/index.php(87): Mage::run('', 'store')
#19 {main}

1 个答案:

答案 0 :(得分:0)

好吧,正如错误所述,在文件中为foreach提供了无效参数,该文件是MageWorx_SearchAutocomplete模块的一部分。唯一的方法是调试到该文件(第93行的app / code / local / MageWorx / SearchAutocomplete / Model / Mysql4 / Fulltext.php),并确保foreach获得一个合适的变量。查看foreach文档。