Skip to content

Commit

Permalink
Do not reindex catalog_product_flat for disabled stores (OpenMage#3251)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
  • Loading branch information
empiricompany and fballiano authored Jul 12, 2023
1 parent ef99684 commit 8aae6e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function matchEvent(Mage_Index_Model_Event $event)
} else {
/** @var Mage_Core_Model_Store $store */
$store = $event->getDataObject();
if ($store && $store->isObjectNew()) {
if ($store && ($store->isObjectNew() || $store->getOrigData('is_active') != $store->getIsActive() && $store->getIsActive())) {
$result = true;
} else {
$result = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,9 @@ protected function _arrayNextKey(array $array, $key)
public function reindexAll()
{
foreach (Mage::app()->getStores() as $storeId => $store) {
if (!$store->getIsActive()) {
continue;
}
$this->prepareFlatTable($storeId);
$this->beginTransaction();
try {
Expand Down

0 comments on commit 8aae6e2

Please sign in to comment.