Skip to content

Commit 0660e47

Browse files
authored
Merge branch '2.4-develop' into no-author/review
2 parents 7606dd0 + a047c76 commit 0660e47

File tree

53 files changed

+1190
-432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1190
-432
lines changed

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/ImportTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Category/Plugin/ImportTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
use Magento\Catalog\Api\ProductRepositoryInterface;
1010
use Magento\Catalog\Model\Config as CatalogConfig;
11+
use Magento\Catalog\Model\Indexer\Product\Category as ProductCategoryIndexer;
12+
use Magento\Catalog\Model\Indexer\Product\Price\Processor as ProductPriceIndexer;
1113
use Magento\Catalog\Model\Product\Visibility;
1214
use Magento\CatalogImportExport\Model\Import\Product\ImageTypeProcessor;
1315
use Magento\CatalogImportExport\Model\Import\Product\LinkProcessor;
@@ -1102,6 +1104,7 @@ protected function _deleteProducts()
11021104
'catalog_product_import_bunch_delete_after',
11031105
['adapter' => $this, 'bunch' => $bunch]
11041106
);
1107+
$this->reindexProducts($idsToDelete);
11051108
}
11061109
}
11071110
return $this;
@@ -1660,7 +1663,7 @@ protected function _saveProducts()
16601663
$prevAttributeSet,
16611664
$attributes
16621665
);
1663-
// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
1666+
// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
16641667
} catch (Skip $skip) {
16651668
// Product is skipped. Go on to the next one.
16661669
}
@@ -2466,9 +2469,17 @@ private function reindexStockStatus(array $productIds): void
24662469
*/
24672470
private function reindexProducts($productIdsToReindex = [])
24682471
{
2469-
$indexer = $this->indexerRegistry->get('catalog_product_category');
2470-
if (is_array($productIdsToReindex) && count($productIdsToReindex) > 0 && !$indexer->isScheduled()) {
2471-
$indexer->reindexList($productIdsToReindex);
2472+
if (is_array($productIdsToReindex) && !empty($productIdsToReindex)) {
2473+
$indexersToReindex = [
2474+
ProductCategoryIndexer::INDEXER_ID,
2475+
ProductPriceIndexer::INDEXER_ID
2476+
];
2477+
foreach ($indexersToReindex as $id) {
2478+
$indexer = $this->indexerRegistry->get($id);
2479+
if (!$indexer->isScheduled()) {
2480+
$indexer->reindexList($productIdsToReindex);
2481+
}
2482+
}
24722483
}
24732484
}
24742485

app/code/Magento/CatalogImportExport/Model/Indexer/Category/Product/Plugin/Import.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

app/code/Magento/CatalogImportExport/Model/Indexer/Product/Category/Plugin/Import.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

app/code/Magento/CatalogImportExport/Model/Indexer/Product/Price/Plugin/Import.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/CatalogImportExport/Model/Indexer/Stock/Plugin/Import.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/CatalogImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)