Skip to content

Commit 20ab79c

Browse files
author
Stanislav Idolov
committed
Revert of AC-1705
1 parent 6d7d32b commit 20ab79c

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Price.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function __construct(
6666
public function execute($ids)
6767
{
6868
$this->_productPriceIndexerRows->execute($ids);
69+
$this->cacheContext->registerEntities(ProductModel::CACHE_TAG, $ids);
6970
}
7071

7172
/**

app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\Catalog\Model\Indexer\Product\Price;
88

9-
use Magento\Catalog\Model\Product;
109
use Magento\Catalog\Model\Product\Type;
1110
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice;
1211
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Factory;
@@ -21,7 +20,6 @@
2120
use Magento\Framework\Exception\InputException;
2221
use Magento\Framework\Exception\LocalizedException;
2322
use Magento\Framework\Exception\NoSuchEntityException;
24-
use Magento\Framework\Indexer\CacheContext;
2523
use Magento\Framework\Indexer\DimensionalIndexerInterface;
2624
use Magento\Framework\Search\Request\Dimension;
2725
use Magento\Framework\Stdlib\DateTime;
@@ -63,6 +61,8 @@ abstract class AbstractAction
6361
protected $_storeManager;
6462

6563
/**
64+
* Currency factory
65+
*
6666
* @var CurrencyFactory
6767
*/
6868
protected $_currencyFactory;
@@ -83,6 +83,8 @@ abstract class AbstractAction
8383
protected $_catalogProductType;
8484

8585
/**
86+
* Indexer price factory
87+
*
8688
* @var Factory
8789
*/
8890
protected $_indexerPriceFactory;
@@ -107,11 +109,6 @@ abstract class AbstractAction
107109
*/
108110
private $tableMaintainer;
109111

110-
/**
111-
* @var CacheContext
112-
*/
113-
private $cacheContext;
114-
115112
/**
116113
* @param ScopeConfigInterface $config
117114
* @param StoreManagerInterface $storeManager
@@ -124,7 +121,6 @@ abstract class AbstractAction
124121
* @param TierPrice|null $tierPriceIndexResource
125122
* @param DimensionCollectionFactory|null $dimensionCollectionFactory
126123
* @param TableMaintainer|null $tableMaintainer
127-
* @param CacheContext|null $cacheContext
128124
* @SuppressWarnings(PHPMD.NPathComplexity)
129125
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
130126
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -140,8 +136,7 @@ public function __construct(
140136
DefaultPrice $defaultIndexerResource,
141137
TierPrice $tierPriceIndexResource = null,
142138
DimensionCollectionFactory $dimensionCollectionFactory = null,
143-
TableMaintainer $tableMaintainer = null,
144-
CacheContext $cacheContext = null
139+
TableMaintainer $tableMaintainer = null
145140
) {
146141
$this->_config = $config;
147142
$this->_storeManager = $storeManager;
@@ -153,15 +148,14 @@ public function __construct(
153148
$this->_defaultIndexerResource = $defaultIndexerResource;
154149
$this->_connection = $this->_defaultIndexerResource->getConnection();
155150
$this->tierPriceIndexResource = $tierPriceIndexResource ?? ObjectManager::getInstance()->get(
156-
TierPrice::class
157-
);
151+
TierPrice::class
152+
);
158153
$this->dimensionCollectionFactory = $dimensionCollectionFactory ?? ObjectManager::getInstance()->get(
159-
DimensionCollectionFactory::class
160-
);
154+
DimensionCollectionFactory::class
155+
);
161156
$this->tableMaintainer = $tableMaintainer ?? ObjectManager::getInstance()->get(
162-
TableMaintainer::class
163-
);
164-
$this->cacheContext = $cacheContext ?? ObjectManager::getInstance()->get(CacheContext::class);
157+
TableMaintainer::class
158+
);
165159
}
166160

167161
/**
@@ -397,7 +391,6 @@ protected function _reindexRows($changedIds = [])
397391

398392
if ($changedIds) {
399393
$this->deleteIndexData($changedIds);
400-
$this->cacheContext->registerEntities(Product::CACHE_TAG, $changedIds);
401394
}
402395

403396
$typeIndexers = $this->getTypeIndexers();

0 commit comments

Comments
 (0)