这可能是Magento的一个特定问题,但到目前为止,从纯PHP的角度看它看起来很奇怪。
我在日志文件中看到的错误是:
Notice: Undefined property: Mage_Sales_Model_Resource_Quote::$_serializableFields in /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php on line 753
第753行是:
foreach ($this->_serializableFields as $field => $parameters) {
_serializableFields
变量在Mage_Core_Model_Resource_Db_Abstract
中定义为:
protected $_serializableFields = array();
Mage_Sales_Model_Resource_Quote
类是Mage_Core_Model_Resource_Db_Abstract
的孙子,但它或其父项中没有任何内容可以取消定义_serializableFields
变量。
所以问题是:为什么变量未定义?试图找出它我记录了导致错误的跟踪:
#0 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(422): Mage_Core_Model_Resource_Db_Abstract->_serializeFields(Object(MageWorx_CustomPrice_Model_Sales_Quote))
#1 /app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(MageWorx_CustomPrice_Model_Sales_Quote))
#2 /app/code/core/Mage/Sales/Model/Quote.php(1966): Mage_Core_Model_Abstract->save()
#3 /app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php(380): Mage_Sales_Model_Quote->save()
#4 /app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php(357): Mage_Adminhtml_Model_Sales_Order_Create->initFromOrder(Object(MyCompany_Sales_Model_Order))
#5 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_CreateController->reorderAction()
#6 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reorder')
#7 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /index.php(87): Mage::run('', 'store')
#11 {main}
2014-03-27T04:25:22+00:00 ERR (3): Notice: Undefined property: Mage_Sales_Model_Resource_Quote::$_serializableFields in /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php on line 753
答案 0 :(得分:0)
这似乎是关于PHP 5.4问题的APC。摆脱了APC,现在一切都很好。安装了Opcache。