2012-05-09 163 views
0

管理面板工作正常,但在前端我得到以下错误。Magento升级1.7导致以下错误

SQLSTATE [23000]:完整性约束冲突:为了要求1052列“位置”不明确

任何想法,那会是什么?

+0

这意味着在JOIN中,列位置正在使用,但存在于两个表中,例如TABLE_A.position和TABLE_B.position,并且连接正在使用位置,但未指定要使用位置的表。 http://stackoverflow.com/questions/8509798/codeigniter-column-id-in-order-clause-is-ambiguous –

+0

感谢您的帮助,但我是一个完整的noob在这,如果你能给我一个提示如何解决这个问题,我会很感激。 – lvekua

+0

我需要比你给我更多的东西。这个错误非常模糊。您是否使用自定义扩展?我可以告诉它是一个SQL语句,但是这可能来自很多变量。 –

回答

1

这是我想出的解决方案,很多感谢Vern Burton。

  1. 位于phpmyadmin中的表eav_attribute,它与catalog_eav_attribute相关。
  2. 找到表eav_attribute中的列位置并将其删除。
  3. 清除所有缓存和重新索引的所有数据,访问了头版,并得到了新的错误:SQLSTATE [42S22]:列未找到:1054未知列“main_table.include_in_menu”在“where子句”

  4. 位于和下面的行打开的文件的应用程序/代码/核心/法师/目录/型号/资源/分类/ Flat.php

  5. 注释掉:267在我的情况----

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

我不太确定这种方法是多么美观,可以解决这个问题,但现在对我来说确实有效,如果有人有更好的方法来解决这个问题,我会很感激,如果你会发布你的解决方案。

希望这会帮助别人,干杯。

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 - > _执行(阵列)
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 ...',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('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 ...',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(对象(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') 35 35 012 012 012 012 012 012 012 (对象(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->调度()
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}

0

您是否试过重建索引?我有一个类似的问题,并修复它。