Magento Sitemap导致错误

时间:2014-04-06 19:41:34

标签: php css magento magento-1.7 block

当我去提交站点地图时,管理员方面突然显示它显示一个白色的屏幕。这是我的错误日志显示的内容。

PHP Fatal error:  Call to a member function getId() on a non-object in /home/investor/public_html/yourvaporizers.com/app/code/core/Mage/Adminhtml/controllers/SitemapController.php on line 99
PHP Fatal error:  Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47

不是编码器,所以不知道如何解决这个问题。

更新 - 我应该添加整个错误代码。

Stack trace:
0 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(63823): PDOStatement->execute(Array)
1      /home/investor/public_html/yourvaporizers.com/includes/src/Varien_Db_Statement_Pdo_Mysql.php    (110): Zend_Db_Statement_Pdo->_execute(Array)
2 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(63411): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
3 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(52806): Zend_Db_Statement->execute(Array)
4 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(53842): Zend_Db_Adapter_Abstract->query('SELECT `mg_core...', Array)
5 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(54687): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `mg_core...', Array)
6 /home/investor/p in /home/investor/public_html/yourvaporizers.com/includes/src/__default.php on line 63829
[07-Apr-2014 07:51:25 UTC] PHP Fatal error:  Call to a member function getCollection() on a non-object in     /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 07:51:28 UTC] PHP Fatal error:  Call to a member function getId() on a non-object in /home/investor/public_html/yourvaporizers.com/app/code/core/Mage/Adminhtml/controllers/SitemapController.php on line 99
[07-Apr-2014 07:51:32 UTC] PHP Fatal error:  Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 08:07:18 UTC] PHP Fatal error:  Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 10:03:37 UTC] PHP Fatal error:  Class 'Mage_Sitemap_Model_Sitemap' not found in /home/investor/public_html/yourvaporizers.com/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php on line 4

1 个答案:

答案 0 :(得分:1)

这是该文件的第99行

#File: app/code/core/Mage/Adminhtml/controllers/SitemapController.php
$this->_title($model->getId() ? $model->getSitemapFilename() : $this->__('New Sitemap'));

因此,看起来Magento试图在getId变量上调用$model,但$model不是对象。如果我们查看分配/定义$model的位置,在库存系统中,我们会看到

#File: app/code/core/Mage/Adminhtml/controllers/SitemapController.php
$model = Mage::getModel('sitemap/sitemap');

因此,您的错误有两个可能的原因。首先,您或其他人在您的Magento系统中安装了一个扩展,它做了一些事情(类重写,行为更改),在尝试实例化sitemap/sitemap模型时导致了可恢复的错误。这导致$modelfalse,并导致您的错误。

第二个是有人更改了此文件或站点地图模型文件(在core或其中一个代码池communitylocal)并执行了导致{ {1}}未定义。

调试步骤包括针对新下载的副本进行区分,并禁用与站点地图功能相关的任何扩展(或最近安装)。至于

  

不是编码器,所以不知道如何解决这个问题。

更好的问题可能是

  

为什么非编码人员使用的系统多年来已证明您需要成为一名编码人员(或愿意学习)。