Magento中不允许序列化吗? [英] Serialization not allowed in Magento?

查看:64
本文介绍了Magento中不允许序列化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Magento中打开缓存时,出现以下异常:

When I turn on cache in Magento, I get the following exception:

不允许对"Mage_Core_Model_Layout_Element"进行序列化

Serialization of 'Mage_Core_Model_Layout_Element' is not allowed

app/code/core/Mage/Page/Block/Template/Links.php的行中发生异常:

return parent::getCacheKeyInfo() + array(
            'links' => base64_encode(serialize($links)),
            'name' => $this->getNameInLayout()
        )

我正在使用Magento Enterprise 1.10和PHP 5.3.

I am using Magento Enterprise 1.10 and PHP 5.3.

谁能告诉我问题出在哪里?

Can anyone tell me what the problem is?

推荐答案

您的布局文件中不应包含空的after_textbefore_text标记.如果您不需要它,则只需删除该标签.

You shouldn't have an empty after_text or before_text tags in your layout file. If you don't need it, just delete the tag at all.

如果这样做没有帮助,请将$links变量转储到app/code/core/Mage/Page/Block/Template/Links.php文件中的第150行之前,您会看到其中包含数组的数组.所有键和值都应该是字符串或整数,而不是对象.数组值的键是一个对象,它将告诉您要从布局文件中删除哪个标签.

If it will not help, dump the $links variable before the 150th line in the app/code/core/Mage/Page/Block/Template/Links.php file, and you will see an array with arrays inside it. All of keys and values should be strings or integers, not objects. The key of array value which is an object will tell you which tag to delete from the layout file.

这篇关于Magento中不允许序列化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆