Magento错误-无效的块类型


Magento Error - Invalid block type

我已经移动magento网站从一个服务器http://example_old.com/到另一个服务器http://example.com/beta/。但在类别/产品列表页面不显示,只出现空白屏幕。当检查错误日志时,显示以下错误:

exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Page_Block_Header' in /var/www/vhosts/example.com/httpdocs/beta/app/Mage.php:595
Stack trace:
#0 /var/www/vhosts/example.com/httpdocs/beta/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /var/www/vhosts/example.com/httpdocs/beta/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('page/header', Array)
#2 /var/www/vhosts/example.com/httpdocs/beta/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('page/header', 'header')
#3 /var/www/vhosts/example.com/httpdocs/beta/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('page/header', 'header')

同样的空白屏幕出现在管理面板

这个错误的原因是什么?

我知道这是6个月后,但我有一个解决方案,如果你仍然需要它。

我也有类似的问题。我在1.9.2.1安装中安装了补丁,然后突然我的产品列表页面是空白的。和你一样,我查看了日志,发现了那个错误。但我觉得这个错误与您正在使用的空白产品列表页面有松散的关系。

为了处理这个错误,我去了我的布局文件,我引用了标题,然后将其加载为子块:

<reference name="header">
        <block type="page/header" name="header">
            <action method="setTemplate">
                ...

当我需要做的只是引用它时,所以我删除了block:

<reference name="header">
        <action method="setTemplate">

这解决了错误日志,但不是通过空白的产品列表页。我不知道你运行的是什么版本的Magento,但我读到人们在1.9.2.2版本中遇到了静态块短代码的问题,详见这里

如果你在类别中使用静态块

我使用静态块短代码的一些类别。要解决这个问题(如上文中dudesjoerd所指出的),您必须前往系统>权限>块:并允许您正在使用的任何块类型(如果有的话)

如果你没有在类别中使用静态块

由于您是从服务器迁移到服务器,而不是应用补丁,我只能建议您的PHP版本不同,并且在您的产品清单PHP文件中存在版本错误。

我希望这对你有帮助!