Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not reindex catalog_product_flat for disabled stores #3251

Merged
merged 10 commits into from
Jul 12, 2023
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())) {
fballiano marked this conversation as resolved.
Show resolved Hide resolved
$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