Skip to content

Commit d8f9d70

Browse files
committed
Merge remote-tracking branch 'mainline/2.3.2-develop' into MC-16880-1
2 parents b220798 + 9ec0aec commit d8f9d70

File tree

42 files changed

+466
-605
lines changed

Some content is hidden

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

42 files changed

+466
-605
lines changed

app/code/Magento/Backend/Block/Context.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Block;
77

8+
use Magento\Framework\Cache\LockGuardedCacheLoader;
9+
810
/**
911
* Constructor modification point for Magento\Backend\Block\AbstractBlock.
1012
*
@@ -17,7 +19,7 @@
1719
* the classes they were introduced for.
1820
*
1921
* @api
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD)
2123
* @since 100.0.2
2224
*/
2325
class Context extends \Magento\Framework\View\Element\Context
@@ -44,8 +46,9 @@ class Context extends \Magento\Framework\View\Element\Context
4446
* @param \Magento\Framework\Escaper $escaper
4547
* @param \Magento\Framework\Filter\FilterManager $filterManager
4648
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
47-
* @param \Magento\Framework\AuthorizationInterface $authorization
4849
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
50+
* @param LockGuardedCacheLoader $lockQuery
51+
* @param \Magento\Framework\AuthorizationInterface $authorization
4952
*
5053
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
5154
*/
@@ -67,6 +70,7 @@ public function __construct(
6770
\Magento\Framework\Filter\FilterManager $filterManager,
6871
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
6972
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
73+
LockGuardedCacheLoader $lockQuery,
7074
\Magento\Framework\AuthorizationInterface $authorization
7175
) {
7276
$this->_authorization = $authorization;
@@ -87,7 +91,8 @@ public function __construct(
8791
$escaper,
8892
$filterManager,
8993
$localeDate,
90-
$inlineTranslation
94+
$inlineTranslation,
95+
$lockQuery
9196
);
9297
}
9398

app/code/Magento/Backend/Block/Template/Context.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Block\Template;
77

8+
use Magento\Framework\Cache\LockGuardedCacheLoader;
9+
810
/**
911
* Constructor modification point for Magento\Backend\Block\Template.
1012
*
@@ -72,6 +74,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context
7274
* @param \Magento\Framework\Filter\FilterManager $filterManager
7375
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
7476
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
77+
* @param LockGuardedCacheLoader $lockQuery
7578
* @param \Magento\Framework\Filesystem $filesystem
7679
* @param \Magento\Framework\View\FileSystem $viewFileSystem
7780
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
@@ -106,6 +109,7 @@ public function __construct(
106109
\Magento\Framework\Filter\FilterManager $filterManager,
107110
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
108111
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
112+
LockGuardedCacheLoader $lockQuery,
109113
\Magento\Framework\Filesystem $filesystem,
110114
\Magento\Framework\View\FileSystem $viewFileSystem,
111115
\Magento\Framework\View\TemplateEnginePool $enginePool,
@@ -143,6 +147,7 @@ public function __construct(
143147
$filterManager,
144148
$localeDate,
145149
$inlineTranslation,
150+
$lockQuery,
146151
$filesystem,
147152
$viewFileSystem,
148153
$enginePool,

app/code/Magento/Backend/Block/Widget/Context.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Block\Widget;
77

8+
use Magento\Framework\Cache\LockGuardedCacheLoader;
9+
810
/**
911
* Constructor modification point for Magento\Backend\Block\Widget.
1012
*
@@ -17,7 +19,7 @@
1719
* the classes they were introduced for.
1820
*
1921
* @api
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD)
2123
* @since 100.0.2
2224
*/
2325
class Context extends \Magento\Backend\Block\Template\Context
@@ -55,6 +57,7 @@ class Context extends \Magento\Backend\Block\Template\Context
5557
* @param \Magento\Framework\Filter\FilterManager $filterManager
5658
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
5759
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
60+
* @param LockGuardedCacheLoader $lockQuery
5861
* @param \Magento\Framework\Filesystem $filesystem
5962
* @param \Magento\Framework\View\FileSystem $viewFileSystem
6063
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
@@ -91,6 +94,7 @@ public function __construct(
9194
\Magento\Framework\Filter\FilterManager $filterManager,
9295
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
9396
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
97+
LockGuardedCacheLoader $lockQuery,
9498
\Magento\Framework\Filesystem $filesystem,
9599
\Magento\Framework\View\FileSystem $viewFileSystem,
96100
\Magento\Framework\View\TemplateEnginePool $enginePool,
@@ -125,6 +129,7 @@ public function __construct(
125129
$filterManager,
126130
$localeDate,
127131
$inlineTranslation,
132+
$lockQuery,
128133
$filesystem,
129134
$viewFileSystem,
130135
$enginePool,

app/code/Magento/Catalog/Block/Product/Context.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Catalog\Block\Product;
77

8+
use Magento\Framework\Cache\LockGuardedCacheLoader;
9+
810
/**
911
* Constructor modification point for Magento\Catalog\Block\Product\AbstractProduct.
1012
*
@@ -17,7 +19,7 @@
1719
* the classes they were introduced for.
1820
*
1921
* @deprecated 101.1.0
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD)
2123
*/
2224
class Context extends \Magento\Framework\View\Element\Template\Context
2325
{
@@ -104,6 +106,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context
104106
* @param \Magento\Framework\Filter\FilterManager $filterManager
105107
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
106108
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
109+
* @param LockGuardedCacheLoader $lockQuery
107110
* @param \Magento\Framework\Filesystem $filesystem
108111
* @param \Magento\Framework\View\FileSystem $viewFileSystem
109112
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
@@ -145,6 +148,7 @@ public function __construct(
145148
\Magento\Framework\Filter\FilterManager $filterManager,
146149
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
147150
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
151+
LockGuardedCacheLoader $lockQuery,
148152
\Magento\Framework\Filesystem $filesystem,
149153
\Magento\Framework\View\FileSystem $viewFileSystem,
150154
\Magento\Framework\View\TemplateEnginePool $enginePool,
@@ -196,6 +200,7 @@ public function __construct(
196200
$filterManager,
197201
$localeDate,
198202
$inlineTranslation,
203+
$lockQuery,
199204
$filesystem,
200205
$viewFileSystem,
201206
$enginePool,
@@ -208,6 +213,8 @@ public function __construct(
208213
}
209214

210215
/**
216+
* Get Stock registry.
217+
*
211218
* @return \Magento\CatalogInventory\Api\StockRegistryInterface
212219
*/
213220
public function getStockRegistry()
@@ -216,6 +223,8 @@ public function getStockRegistry()
216223
}
217224

218225
/**
226+
* Get cart helper.
227+
*
219228
* @return \Magento\Checkout\Helper\Cart
220229
*/
221230
public function getCartHelper()
@@ -224,6 +233,8 @@ public function getCartHelper()
224233
}
225234

226235
/**
236+
* Get catalog config.
237+
*
227238
* @return \Magento\Catalog\Model\Config
228239
*/
229240
public function getCatalogConfig()
@@ -232,6 +243,8 @@ public function getCatalogConfig()
232243
}
233244

234245
/**
246+
* Get catalog helper.
247+
*
235248
* @return \Magento\Catalog\Helper\Data
236249
*/
237250
public function getCatalogHelper()
@@ -240,6 +253,8 @@ public function getCatalogHelper()
240253
}
241254

242255
/**
256+
* Get compare product.
257+
*
243258
* @return \Magento\Catalog\Helper\Product\Compare
244259
*/
245260
public function getCompareProduct()
@@ -248,6 +263,8 @@ public function getCompareProduct()
248263
}
249264

250265
/**
266+
* Get image helper.
267+
*
251268
* @return \Magento\Catalog\Helper\Image
252269
*/
253270
public function getImageHelper()
@@ -256,6 +273,8 @@ public function getImageHelper()
256273
}
257274

258275
/**
276+
* Get image builder.
277+
*
259278
* @return \Magento\Catalog\Block\Product\ImageBuilder
260279
*/
261280
public function getImageBuilder()
@@ -264,6 +283,8 @@ public function getImageBuilder()
264283
}
265284

266285
/**
286+
* Get math random.
287+
*
267288
* @return \Magento\Framework\Math\Random
268289
*/
269290
public function getMathRandom()
@@ -272,6 +293,8 @@ public function getMathRandom()
272293
}
273294

274295
/**
296+
* Get registry.
297+
*
275298
* @return \Magento\Framework\Registry
276299
*/
277300
public function getRegistry()
@@ -280,6 +303,8 @@ public function getRegistry()
280303
}
281304

282305
/**
306+
* Get tax data.
307+
*
283308
* @return \Magento\Tax\Helper\Data
284309
*/
285310
public function getTaxData()
@@ -288,6 +313,8 @@ public function getTaxData()
288313
}
289314

290315
/**
316+
* Get wishlist helper.
317+
*
291318
* @return \Magento\Wishlist\Helper\Data
292319
*/
293320
public function getWishlistHelper()
@@ -296,6 +323,8 @@ public function getWishlistHelper()
296323
}
297324

298325
/**
326+
* Get review renderer.
327+
*
299328
* @return \Magento\Catalog\Block\Product\ReviewRendererInterface
300329
*/
301330
public function getReviewRenderer()

app/code/Magento/CatalogInventory/Model/AddStockStatusToCollection.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
namespace Magento\CatalogInventory\Model;
88

99
use Magento\Catalog\Model\ResourceModel\Product\Collection;
10-
use Magento\Framework\Search\EngineResolverInterface;
11-
use Magento\Search\Model\EngineResolver;
1210

1311
/**
1412
* Catalog inventory module plugin
@@ -20,21 +18,13 @@ class AddStockStatusToCollection
2018
*/
2119
protected $stockHelper;
2220

23-
/**
24-
* @var EngineResolverInterface
25-
*/
26-
private $engineResolver;
27-
2821
/**
2922
* @param \Magento\CatalogInventory\Helper\Stock $stockHelper
30-
* @param EngineResolverInterface $engineResolver
3123
*/
3224
public function __construct(
33-
\Magento\CatalogInventory\Helper\Stock $stockHelper,
34-
EngineResolverInterface $engineResolver
25+
\Magento\CatalogInventory\Helper\Stock $stockHelper
3526
) {
3627
$this->stockHelper = $stockHelper;
37-
$this->engineResolver = $engineResolver;
3828
}
3929

4030
/**
@@ -47,9 +37,7 @@ public function __construct(
4737
*/
4838
public function beforeLoad(Collection $productCollection, $printQuery = false, $logQuery = false)
4939
{
50-
if ($this->engineResolver->getCurrentSearchEngine() === EngineResolver::CATALOG_SEARCH_MYSQL_ENGINE) {
51-
$this->stockHelper->addIsInStockFilterToCollection($productCollection);
52-
}
40+
$this->stockHelper->addIsInStockFilterToCollection($productCollection);
5341
return [$printQuery, $logQuery];
5442
}
5543
}

0 commit comments

Comments
 (0)