Magento升级1.7导致以下错误 [英] Magento upgrade 1.7 caused following error

查看:62
本文介绍了Magento升级1.7导致以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

管理面板工作正常,但在前端出现以下错误.

Admin panel works fine, but on front-end I get following error.

SQLSTATE [23000]:违反完整性约束:1052 order子句中的列"position"不明确

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'position' in order clause is ambiguous

有什么想法吗?

推荐答案

这是我想出的解决方案,非常感谢Vern Burton.

Here is the solution i came up with, Many Thanks to Vern Burton.

  1. 在phpmyadmin中找到与eatalog_eav_attribute相关的表eav_attribute.
  2. 在表eav_attribute中找到列位置并将其删除.
  3. 清除所有缓存并为所有数据重新索引,访问首页并收到新的错误:SQLSTATE [42S22]:找不到列:1054"where子句"中的未知列"main_table.include_in_menu"

  1. Located table eav_attribute in phpmyadmin, which was related to catalog_eav_attribute.
  2. Located column position in table eav_attribute and dropped it.
  3. Cleared all cache and reindexed all data, visited front page and got a new error: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘main_table.include_in_menu’ in ‘where clause’

已找到并打开文件app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php

Located and opened file app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php

在我的情况下评论以下行:267 ----

Commented out following line:267 in my case ----

    ->where('main_table.is_active = ?', '1')
   // ->where('main_table.include_in_menu = ?', '1') 
    ->order('main_table.position');

我不太确定此方法可以解决此问题的美观程度,但是,现在肯定对我有用.如果有人有更好的解决方法,我将不胜感激,如果您能发布解决方案.

I'm not really sure how esthetic this method is to fix this issue but, certainly works for me for now, If anyone has better way of fixing this I'd appreciate if you'll post your solution.

希望这会帮助某人,干杯.

Hope this will help someone out, Cheers.

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'position' in order clause is ambiguous' in /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Statement/Pdo.php:234

堆栈跟踪:
0/chroot/home/user/my_domain.com/magento_root/lib/Varien/Db/Statement/Pdo/Mysql.php(110):Zend_Db_Statement_Pdo-> _ execute(Array)
1/chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Statement.php(300):Varien_Db_Statement_Pdo_Mysql-> _ execute(Array)
2/chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(479):Zend_Db_Statement-> execute(Array)
3/chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):Zend_Db_Adapter_Abstract-> query('SELECT main_ta...', Array) <br>4 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT main_ta ...',大批)
5/chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(734):Varien_Db_Adapter_Pdo_Mysql-> query('SELECT main_ta...', Array) <br>6 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT main_ta ...',Array)
7/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521):Varien_Data_Collection_Db-> _ fetchAll('SELECT` main_ta ...',数组)
8/chroot/home/user/my_domain.com/magento_root/lib/Varien/Data/Collection/Db.php(566):Mage_Core_Model_Resource_Db_Collection_Abstract-> getData()
9/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Model/Layer.php(232):Varien_Data_Collection_Db-> load()
10/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Block/Layer/View.php(163):Mage_Catalog_Model_Layer-> getFilterableAttributes()
11/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Block/Layer/View.php(122):Mage_Catalog_Block_Layer_View-> _ getFilterableAttributes()
12/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Block/Abstract.php(238):Mage_Catalog_Block_Layer_View-> _ prepareLayout()
13/chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(430):Mage_Core_Block_Abstract-> setLayout(Object(Mage_Core_Model_Layout))
14/chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(446):Mage_Core_Model_Layout-> createBlock('catalog/layer_v ...', 'catalog.leftnav')
15/chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(238):Mage_Core_Model_Layout-> addBlock('catalog/layer_v ...', 'catalog.leftnav')
16/chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(204):Mage_Core_Model_Layout-> _ generateBlock(Object(Mage_Core_Model_Layout_Element),Object(Mage_Core_Model_Layout_Element) )
17/chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(209):Mage_Core_Model_Layout-> generateBlocks(Object(Mage_Core_Model_Layout_Element))
18/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Action.php(344):Mage_Core_Model_Layout-> generateBlocks()
19/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Helper/Product/View.php(73):Mage_Core_Controller_Varien_Action-> generateLayoutBlocks()
20/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Helper/Product/View.php(144):Mage_Catalog_Helper_Product_View-> initProductLayout(Object(Mage_Catalog_Model_Product),Object( Mage_Catalog_ProductController))
21/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/controllers/ProductController.php(132):Mage_Catalog_Helper_Product_View-> prepareAndRender(28491,Object(Mage_Catalog_ProductController),Object( Varien_Object))
22/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Action.php(419):Mage_Catalog_ProductController-> viewAction()
23/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250):Mage_Core_Controller_Varien_Action-> dispatch('view')
24/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Front.php(176):Mage_Core_Controller_Varien_Router_Standard-> match(Object(Mage_Core_Controller_Request_Http))
25/chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Model/App.php(354):Mage_Core_Controller_Varien_Front-> dispatch()
26/chroot/home/user/my_domain.com/magento_root/app/Mage.php(683):Mage_Core_Model_App-> run(Array)
27/chroot/home/user/my_domain.com/magento_root/index.php(87):Mage :: run('','store')
28 {main}

Stack trace:
0 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
1 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
2 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
3 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT main_ta...', Array) <br>4 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECTmain_ta...', Array)
5 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT main_ta...', Array) <br>6 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECTmain_ta...', Array)
7 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
8 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
9 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Model/Layer.php(232): Varien_Data_Collection_Db->load()
10 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Block/Layer/View.php(163): Mage_Catalog_Model_Layer->getFilterableAttributes()
11 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Block/Layer/View.php(122): Mage_Catalog_Block_Layer_View->_getFilterableAttributes()
12 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Catalog_Block_Layer_View->_prepareLayout()
13 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(430): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
14 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(446): Mage_Core_Model_Layout->createBlock('catalog/layer_v...', 'catalog.leftnav')
15 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(238): Mage_Core_Model_Layout->addBlock('catalog/layer_v...', 'catalog.leftnav')
16 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(204): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
17 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(209): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
18 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
19 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Helper/Product/View.php(73): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
20 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Helper/Product/View.php(144): Mage_Catalog_Helper_Product_View->initProductLayout(Object(Mage_Catalog_Model_Product), Object(Mage_Catalog_ProductController))
21 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(28491, Object(Mage_Catalog_ProductController), Object(Varien_Object))
22 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_ProductController->viewAction()
23 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
24 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
25 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
26 /chroot/home/user/my_domain.com/magento_root/app/Mage.php(683): Mage_Core_Model_App->run(Array)
27 /chroot/home/user/my_domain.com/magento_root/index.php(87): Mage::run('', 'store')
28 {main}

这篇关于Magento升级1.7导致以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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