0

管理パネルは正常に動作しますが、フロントエンドで次のエラーが発生します。

SQLSTATE[23000]: 整合性制約違反: 1052 列 'position' in order 句があいまいです

これは何でしょうか?

4

2 に答える 2

1

これが私が思いついた解決策です。 Vern Burton に感謝します。

  1. catalog_eav_attribute に関連する phpmyadmin のテーブル eav_attribute を見つけました。
  2. テーブル eav_attribute で列の位置を特定し、削除しました。
  3. すべてのキャッシュをクリアし、すべてのデータのインデックスを再作成し、フロント ページにアクセスして、新しいエラーを受け取りました: SQLSTATE[42S22]: 列が見つかりません: 1054 不明な列 'main_table.include_in_menu' in 'where clause'</p>

  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');
    

この方法がこの問題を修正するのにどれほど美的かはよくわかりませんが、今のところは確かにうまくいきます。これを修正するより良い方法があれば、解決策を投稿していただければ幸いです。

これが誰かを助けることを願っています、乾杯。

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(配列)
1 /chroot/home/user/my_domain .com/magento_root/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(配列)
2 /chroot/home/user/my_domain.com/magento_root/lib/Zend/Db/Adapter/Abstract.php (479): Zend_Db_Statement->execute(配列)
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.. .'、配列)
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(オブジェクト(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/コア/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(オブジェクト(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, オブジェクト(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->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(配列)
27 /chroot/home/user/my_domain.com/magento_root/index.php(87): Mage::run('', 'store')
28 {main }

于 2012-05-16T05:21:46.390 に答える
0

インデックスを再構築してみましたか?私も同様の問題を抱えていましたが、それで修正されました。

于 2012-05-29T15:15:35.177 に答える