Unable to reindex after adding extension using Multi-Warehouse 'Insert value list does not match column list'

magento.stackexchange https://magento.stackexchange.com/questions/10758

문제

I'm having a conflict between two plugins, and can't reindex Product Prices. The plugins are X-Multi-Warehouse and Simple Configurable Products. It looks like Multi-Warehouse added the column stock_id to catalog_product_index_tier_price, and now the insert number of columns doesn't match. I'm not sure where to change the code to reflect this change. It's running Magento 1.8

Error log:

## 2013-11-13 13:58:55
## 28663 ## QUERY
SQL: DESCRIBE `catalog_product_index_tier_price`
AFF: 5
TIME: 0.0006

## 2013-11-13 13:58:55
## 28663 ## QUERY
SQL: INSERT INTO `catalog_product_index_tier_price` SELECT `tp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, MIN(IF(tp.website_id = 0, ROUND(tp.value * cwd.rate, 4), tp.value)) FROM `catalog_product_entity_tier_price` AS `tp`
 INNER JOIN `customer_group` AS `cg` ON tp.all_groups = 1 OR (tp.all_groups = 0 AND tp.customer_group_id = cg.customer_group_id)
 INNER JOIN `core_website` AS `cw` ON tp.website_id = 0 OR tp.website_id = cw.website_id
 INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id WHERE (cw.website_id != 0) GROUP BY `tp`.`entity_id`,
    `cg`.`customer_group_id`,
    `cw`.`website_id` ON DUPLICATE KEY UPDATE `min_price` = VALUES(`min_price`)
TIME: 0.0008

## 2013-11-13 13:58:55
EXCEPTION 
exception 'PDOException' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in magento/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 magento/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 magento/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 magento/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 magento/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(455): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#7 magento/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(379): Mage_Catalog_Model_Resource_Product_Indexer_Price->_prepareTierPriceIndex()
#8 magento/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
#9 magento/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 magento/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#11 magento/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(127): Mage_Index_Model_Process->reindexEverything()
#12 magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#16 magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#17 magento/index.php(87): Mage::run('', 'store')
#18 {main}

I'm still pretty new to Magento. Apologies if this is super-specific.

도움이 되었습니까?

해결책

Actually it's just a bug in the Simple Configurable Products extension but the weird thing is that your debug backtrace should show at least one file of that extension.

I've fixed this once but can't remember exactly how. It was in the OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Mysql4_Indexer_Stock_Configurable class.

Honestly if possible I would advice against using the extension all together. It does quite a lot of rewriting and causes a lot of bugs with other extensions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top