Skip to content

Commit 890d7dd

Browse files
merge magento/2.2.10-develop into magento-tsg/MC-19568
2 parents 3ff44f9 + 4e95621 commit 890d7dd

File tree

9 files changed

+140
-322
lines changed

9 files changed

+140
-322
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenStorefrontProductPageActionGroup.xml

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

app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\DB\Adapter\AdapterInterface;
1212
use Magento\CatalogInventory\Api\StockConfigurationInterface;
1313
use Magento\CatalogInventory\Model\Indexer\Stock\Action\Full;
14+
use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus;
1415

1516
/**
1617
* CatalogInventory Default Stock Status Indexer Resource Model
@@ -225,6 +226,8 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f
225226
{
226227
$connection = $this->getConnection();
227228
$qtyExpr = $connection->getCheckSql('cisi.qty > 0', 'cisi.qty', 0);
229+
$metadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class);
230+
$linkField = $metadata->getLinkField();
228231

229232
$select = $connection->select()->from(
230233
['e' => $this->getTable('catalog_product_entity')],
@@ -238,6 +241,12 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f
238241
['cisi' => $this->getTable('cataloginventory_stock_item')],
239242
'cisi.stock_id = cis.stock_id AND cisi.product_id = e.entity_id',
240243
[]
244+
)->joinInner(
245+
['mcpei' => $this->getTable('catalog_product_entity_int')],
246+
'e.' . $linkField . ' = mcpei.' . $linkField
247+
. ' AND mcpei.attribute_id = ' . $this->_getAttribute('status')->getId()
248+
. ' AND mcpei.value = ' . ProductStatus::STATUS_ENABLED,
249+
[]
241250
)->columns(
242251
['qty' => $qtyExpr]
243252
)->where(
@@ -308,8 +317,7 @@ protected function _updateIndex($entityIds)
308317
}
309318

310319
/**
311-
* Delete records by their ids from index table.
312-
*
320+
* Delete records by their ids from index table
313321
* Used to clean table before re-indexation
314322
*
315323
* @param array $ids
@@ -354,8 +362,6 @@ public function getIdxTable($table = null)
354362
}
355363

356364
/**
357-
* Get status expression
358-
*
359365
* @param AdapterInterface $connection
360366
* @param bool $isAggregate
361367
* @return mixed
@@ -381,8 +387,6 @@ protected function getStatusExpression(AdapterInterface $connection, $isAggregat
381387
}
382388

383389
/**
384-
* Get stock configuration
385-
*
386390
* @return StockConfigurationInterface
387391
*
388392
* @deprecated 100.1.0
@@ -398,8 +402,6 @@ protected function getStockConfiguration()
398402
}
399403

400404
/**
401-
* Get query processor composite
402-
*
403405
* @return QueryProcessorComposite
404406
*/
405407
private function getQueryProcessorComposite()

app/code/Magento/Store/Model/ScopeTreeProvider.php

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,30 @@ public function get()
7979
'scopes' => [],
8080
];
8181

82-
/** @var Group $group */
83-
foreach ($groups[$website->getId()] as $group) {
84-
$groupScope = [
85-
'scope' => ScopeInterface::SCOPE_GROUP,
86-
'scope_id' => $group->getId(),
87-
'scopes' => [],
88-
];
89-
90-
/** @var Store $store */
91-
foreach ($stores[$group->getId()] as $store) {
92-
$storeScope = [
93-
'scope' => ScopeInterface::SCOPE_STORES,
94-
'scope_id' => $store->getId(),
82+
if (!empty($groups[$website->getId()])) {
83+
/** @var Group $group */
84+
foreach ($groups[$website->getId()] as $group) {
85+
$groupScope = [
86+
'scope' => ScopeInterface::SCOPE_GROUP,
87+
'scope_id' => $group->getId(),
9588
'scopes' => [],
9689
];
97-
$groupScope['scopes'][] = $storeScope;
90+
91+
if (!empty($stores[$group->getId()])) {
92+
/** @var Store $store */
93+
foreach ($stores[$group->getId()] as $store) {
94+
$storeScope = [
95+
'scope' => ScopeInterface::SCOPE_STORES,
96+
'scope_id' => $store->getId(),
97+
'scopes' => [],
98+
];
99+
$groupScope['scopes'][] = $storeScope;
100+
}
101+
}
102+
$websiteScope['scopes'][] = $groupScope;
98103
}
99-
$websiteScope['scopes'][] = $groupScope;
100104
}
105+
101106
$defaultScope['scopes'][] = $websiteScope;
102107
}
103108

dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attribute.php

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

dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attribute_rollback.php

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

0 commit comments

Comments
 (0)