Magento升级1.7导致以下错误

时间:2012-05-09 16:17:25

标签: sql magento upgrade

管理面板工作正常,但在前端我遇到以下错误。

SQLSTATE [23000]:完整性约束违规:1052订单子句中的“位置”列不明确

知道这可能是什么?

2 个答案:

答案 0 :(得分:1)

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

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

    < / LI>
  4. 找到并打开文件app / code / core / Mage / Catalog / Model / Resource / Category / Flat.php

  5. 以下注释:在我的案例中为267 ----

        ->where('main_table.is_active = ?', '1')
       // ->where('main_table.include_in_menu = ?', '1') 
        ->order('main_table.position');
    
  6. 我不确定这种方法对于解决这个问题是多么美妙,但是,对我来说当然有效,如果有人有更好的方法来解决这个问题,我会感激你,如果你发布的话你的解决方案。

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

    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-&gt; _execute(Array)
    1 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Statement.php(300):Varien_Db_Statement_Pdo_Mysql-&gt; _execute(Array)
    2 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(479):Zend_Db_Statement-&gt; execute(Array)
    3 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):Zend_Db_Adapter_Abstract-&gt;查询(&#39; SELECT {{1} } main_ta ...&#39;,数组)
    5 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php(734):Varien_Db_Adapter_Pdo_Mysql-&gt;查询(&#39; 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 ......&#39;,数组)
    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-&gt; _fetchAll(& #39; SELECT`main_ta ...&#39;,Array)
    8 /chroot/home/user/my_domain.com/magento_root/lib/Varien/Data/Collection/Db.php(566):Mage_Core_Model_Resource_Db_Collection_Abstract-&gt; getData()
    9 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Catalog/Model/Layer.php(232):Varien_Data_Collection_Db-&gt; 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-&gt; _getFilterableAttributes()
    12 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Block/Abstract.php(238):Mage_Catalog_Block_Layer_View-&gt; _prepareLayout()
    13 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(430):Mage_Core_Block_Abstract-&gt; 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-&gt; createBlock(&#39; catalog / layer_v ...&#39;,&#39; catalog.leftnav&#39;)
    15 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(238):Mage_Core_Model_Layout-&gt; addBlock(&#39; catalog / layer_v ...&#39;,&#39; catalog.leftnav&#39;)
    16 /chroot/home/user/my_domain.com/magento_root/app/code/local/Mage/Core/Model/Layout.php(204):Mage_Core_Model_Layout-&gt; _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-&gt; 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-&gt; 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-&gt; 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-&gt; initProductLayout(Object(Mage_Catalog_Model_Product),对象(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-&gt; prepareAndRender(28491,Object(Mage_Catalog_ProductController),对象(Varien_Object))
    22 /chroot/home/user/my_domain.com/magento_root/app/code/core/Mage/Core/Controller/Varien/Action.php(419):Mage_Catalog_ProductController-&gt; 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-&gt; dispatch(&#39) ;视图&#39;)
    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-&gt; 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-&gt; 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(&#39;&#39;,&#39; store&#39;)
    28 {main}

答案 1 :(得分:0)

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