Skip to content

Commit 6defced

Browse files
author
Oleksandr Iegorov
committed
MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex
1 parent 2710b88 commit 6defced

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

app/code/Magento/Catalog/Observer/CategoryProductIndexer.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Magento\Catalog\Observer;
99

1010
use Magento\Catalog\Model\Indexer\Category\Product\Processor;
11-
use Magento\Catalog\Model\Indexer\Category\Flat\State as FlatState;
1211
use Magento\Framework\Event\Observer;
1312
use Magento\Framework\Event\ObserverInterface;
1413

@@ -22,21 +21,12 @@ class CategoryProductIndexer implements ObserverInterface
2221
*/
2322
private $processor;
2423

25-
/**
26-
* @var FlatState
27-
*/
28-
private $flatState;
29-
3024
/**
3125
* @param Processor $processor
32-
* @param FlatState $flatState
3326
*/
34-
public function __construct(
35-
Processor $processor,
36-
FlatState $flatState
37-
) {
27+
public function __construct(Processor $processor)
28+
{
3829
$this->processor = $processor;
39-
$this->flatState = $flatState;
4030
}
4131

4232
/**
@@ -45,7 +35,7 @@ public function __construct(
4535
public function execute(Observer $observer): void
4636
{
4737
$productIds = $observer->getEvent()->getProductIds();
48-
if (!empty($productIds) && $this->processor->isIndexerScheduled() && $this->flatState->isFlatEnabled()) {
38+
if (!empty($productIds) && $this->processor->isIndexerScheduled()) {
4939
$this->processor->markIndexerAsInvalid();
5040
}
5141
}

0 commit comments

Comments
 (0)