Magento中不允许序列化吗? [英] Serialization not allowed in 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_text
或before_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屋!