-
-
Notifications
You must be signed in to change notification settings - Fork 452
Description
While looking at the Indexer Code, i noticed this Event:
magento-lts/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php
Lines 372 to 376 in 1699e42
| Mage::dispatchEvent('catalog_product_prepare_index_select', [ | |
| 'website' => $website, | |
| 'select' => $select, | |
| 'bind' => $bind, | |
| ]); |
the problem is, that all the other instances of this Event uses this Params instead:
magento-lts/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php
Lines 271 to 276 in 1699e42
| Mage::dispatchEvent('catalog_product_prepare_index_select', [ | |
| 'select' => $select, | |
| 'entity_field' => new Zend_Db_Expr('e.entity_id'), | |
| 'website_field' => new Zend_Db_Expr('cw.website_id'), | |
| 'store_field' => new Zend_Db_Expr('cs.store_id'), | |
| ]); |
And the Only instance in Magento there it is used, also checks for these exact params:
magento-lts/app/code/core/Mage/CatalogInventory/Model/Observer.php
Lines 909 to 911 in 1699e42
| $select = $observer->getEvent()->getSelect(); | |
| $entity = $observer->getEvent()->getEntityField(); | |
| $website = $observer->getEvent()->getWebsiteField(); |
So shouldn't it crash in the CatalogInventory there?
magento-lts/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php
Lines 207 to 212 in 1699e42
| $select->join( | |
| ['ciss' => $this->getMainTable()], | |
| "ciss.product_id = {$entityField} AND ciss.website_id = {$websiteField}", | |
| [], | |
| ); | |
| $select->where('ciss.stock_status = ?', Mage_CatalogInventory_Model_Stock_Status::STATUS_IN_STOCK); |
I try to find a way to trigger the Error in the Price_Index function.
If it is really an error, it got unnoticed for 16+ years.