我目前正在开发一个Magento商店(版本1.6.2.0)但是当我点击网址重写管理时,我得到一个Magento错误页面,下面是Magento错误日志中的信息。
到目前为止,我已尝试过以下
2012-01-23T17:16:21+00:00 ERR (3):
exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1' in /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Core/Model/Config.php:1350
Stack trace:
#0 /var/www/vhosts/www.domain.co.uk/httpdocs/app/Mage.php(432): Mage_Core_Model_Config->getModelInstance('eav/entity_attr...', 'SQLSTATE[42000]...')
#1 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(661): Mage::getModel('eav/entity_attr...', 'SQLSTATE[42000]...')
#2 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1624): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterLo...', Array)
#3 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(964): Mage_Eav_Model_Entity_Abstract->_afterLoad(Object(Mage_Catalog_Model_Product))
#4 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), 213, NULL)
#5 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), 213, NULL)
#6 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Catalog/Helper/Product.php(294): Mage_Core_Model_Abstract->load(213)
#7 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Catalog/Helper/Product/View.php(121): Mage_Catalog_Helper_Product->initProduct(213, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#8 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(213, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#9 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Catalog_ProductController->viewAction()
#10 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#11 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/vhosts/www.domain.co.uk/httpdocs/app/code/local/Mage/Core/Model/App.php(348): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/vhosts/www.domain.co.uk/httpdocs/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#15 /var/www/vhosts/www.domain.co.uk/httpdocs/index.php(80): Mage::run('base', 'website')
#16 {main}
如果有人能帮助我解决这个问题,我将不胜感激!
提前致谢
答案 0 :(得分:0)
事实证明错误是在walkAttributes('backend/afterLo...', Array)
阶段抛出的。我每次进入该功能时都发了一封电子邮件,结果发现需要更新已安装属性的旧插件作为系统。所以它正在寻找一个不存在的模型。
答案 1 :(得分:0)
我的客户网站的第三方模块遇到了同样的问题,供应商可以自定义他们的产品'安排一些假期。
原来他们忘了以管理员身份运行保存。
在使用以下内容保存之前解决:
$product->save()
只需将当前商店设置为管理员
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID)