Skip to content

Commit 6a912c2

Browse files
authored
Merge branch '2.4-develop' into fallback-to-storelabels-customer-attributes
2 parents fc9b841 + dc14e50 commit 6a912c2

File tree

3,678 files changed

+14737
-228095
lines changed

Some content is hidden

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

3,678 files changed

+14737
-228095
lines changed

.github/ISSUE_TEMPLATE/story.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: GraphQL Story
3+
about: User story for GraphQL project
4+
labels: 'Project: GraphQL'
5+
6+
---
7+
8+
*As a ___ I want to ___ so that ___.*
9+
10+
### AC
11+
* a
12+
* b
13+
### Approved Schema
14+
* a

.php_cs.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
$finder = PhpCsFixer\Finder::create()
1212
->name('*.phtml')
13-
->exclude('dev/tests/functional/generated')
14-
->exclude('dev/tests/functional/var')
15-
->exclude('dev/tests/functional/vendor')
1613
->exclude('dev/tests/integration/tmp')
1714
->exclude('dev/tests/integration/var')
1815
->exclude('lib/internal/Cm')
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CliCacheCleanActionGroup">
12+
<annotations>
13+
<description>Run cache:clean by CLI with specified cache tags (space separated).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="tags" type="string"/>
17+
</arguments>
18+
19+
<magentoCLI command="cache:clean" arguments="{{tags}}" stepKey="cleanSpecifiedCache"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CliCacheFlushActionGroup">
12+
<annotations>
13+
<description>Run cache:flush by CLI with specified cache tags (space separated).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="tags" type="string"/>
17+
</arguments>
18+
19+
<magentoCLI command="cache:flush" arguments="{{tags}}" stepKey="flushSpecifiedCache"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<group value="login"/>
2121
</annotations>
2222

23+
2324
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2425
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
2526
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
377377
]
378378
);
379379

380-
$query = $select->insertFromSelect($this->getBundlePriceTable());
381-
$connection->query($query);
380+
$this->tableMaintainer->insertFromSelect($select, $this->getBundlePriceTable(), []);
382381
}
383382

384383
/**
@@ -418,8 +417,7 @@ private function calculateBundleOptionPrice($priceTable, $dimensions)
418417
]
419418
);
420419

421-
$query = $select->insertFromSelect($this->getBundleOptionTable());
422-
$connection->query($query);
420+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleOptionTable(), []);
423421

424422
$this->getConnection()->delete($priceTable->getTableName());
425423
$this->applyBundlePrice($priceTable);
@@ -575,8 +573,7 @@ private function calculateFixedBundleSelectionPrice()
575573
'tier_price' => $tierExpr,
576574
]
577575
);
578-
$query = $select->insertFromSelect($this->getBundleSelectionTable());
579-
$connection->query($query);
576+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
580577

581578
$this->applyFixedBundleSelectionPrice();
582579
}
@@ -627,8 +624,7 @@ private function calculateDynamicBundleSelectionPrice($dimensions)
627624
'tier_price' => $tierExpr,
628625
]
629626
);
630-
$query = $select->insertFromSelect($this->getBundleSelectionTable());
631-
$connection->query($query);
627+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
632628
}
633629

634630
/**
@@ -697,8 +693,7 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
697693
$select->where($this->dimensionToFieldMapper[$dimension->getName()] . ' = ?', $dimension->getValue());
698694
}
699695

700-
$query = $select->insertFromSelect($this->getTable('catalog_product_index_tier_price'));
701-
$connection->query($query);
696+
$this->tableMaintainer->insertFromSelect($select, $this->getTable('catalog_product_index_tier_price'), []);
702697
}
703698

704699
/**
@@ -725,8 +720,7 @@ private function applyBundlePrice($priceTable): void
725720
]
726721
);
727722

728-
$query = $select->insertFromSelect($priceTable->getTableName());
729-
$this->getConnection()->query($query);
723+
$this->tableMaintainer->insertFromSelect($select, $priceTable->getTableName(), []);
730724
}
731725

732726
/**
@@ -785,7 +779,7 @@ private function getMainTable($dimensions)
785779
if ($this->fullReindexAction) {
786780
return $this->tableMaintainer->getMainReplicaTable($dimensions);
787781
}
788-
return $this->tableMaintainer->getMainTable($dimensions);
782+
return $this->tableMaintainer->getMainTableByDimensions($dimensions);
789783
}
790784

791785
/**

app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<requiredEntity createDataKey="createBundleOption"/>
3535
<requiredEntity createDataKey="createSimpleProduct"/>
3636
</createData>
37-
<magentoCron stepKey="runCronIndex" groups="index"/>
37+
<magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/>
3838
</before>
3939
<after>
4040
<!-- Delete Simple Product -->
@@ -56,9 +56,11 @@
5656
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
5757
<argument name="product" value="UpdateAttributeNameAndDescription"/>
5858
</actionGroup>
59-
<!--Run cron twice-->
60-
<magentoCLI command="cron:run" stepKey="cronRun"/>
61-
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
59+
<!-- Start message queue for product attribute consumer -->
60+
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
61+
<argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/>
62+
<argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/>
63+
</actionGroup>
6264
<!-- Search for a product with a new name and Open Product -->
6365
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchWithNewProductName">
6466
<argument name="product" value="UpdateAttributeNameAndDescription"/>

app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getItems()
149149
$this->_compareProduct->setAllowUsedFlat(false);
150150

151151
$this->_items = $this->_itemCollectionFactory->create();
152-
$this->_items->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
152+
$this->_items->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());
153153

154154
if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
155155
$this->_items->setCustomerId($this->currentCustomer->getCustomerId());

app/code/Magento/Catalog/Helper/Product/Compare.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function getItemCollection()
279279
// cannot be placed in constructor because of the cyclic dependency which cannot be fixed with proxy class
280280
// collection uses this helper in constructor when calling isEnabledFlat() method
281281
$this->_itemCollection = $this->_itemCollectionFactory->create();
282-
$this->_itemCollection->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
282+
$this->_itemCollection->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());
283283

284284
if ($this->_customerSession->isLoggedIn()) {
285285
$this->_itemCollection->setCustomerId($this->_customerSession->getCustomerId());
@@ -313,7 +313,7 @@ public function calculate($logout = false)
313313
{
314314
/** @var $collection Collection */
315315
$collection = $this->_itemCollectionFactory->create()
316-
->useProductItem(true);
316+
->useProductItem();
317317
if (!$logout && $this->_customerSession->isLoggedIn()) {
318318
$collection->setCustomerId($this->_customerSession->getCustomerId());
319319
} elseif ($this->_customerId) {

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected function _syncData(array $processIds = [])
173173
}
174174
}
175175

176-
$query = $insertSelect->insertFromSelect($this->tableMaintainer->getMainTable($dimensions));
176+
$query = $insertSelect->insertFromSelect($this->tableMaintainer->getMainTableByDimensions($dimensions));
177177
$this->getConnection()->query($query);
178178
}
179179
return $this;
@@ -385,7 +385,7 @@ protected function _reindexRows($changedIds = [])
385385
// copy to index
386386
$this->_insertFromTable(
387387
$temporaryTable,
388-
$this->tableMaintainer->getMainTable($dimensions)
388+
$this->tableMaintainer->getMainTableByDimensions($dimensions)
389389
);
390390
}
391391
} else {
@@ -401,14 +401,16 @@ protected function _reindexRows($changedIds = [])
401401
}
402402

403403
/**
404+
* Delete Index data
405+
*
404406
* @param array $entityIds
405407
* @return void
406408
*/
407409
private function deleteIndexData(array $entityIds)
408410
{
409411
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
410412
$select = $this->getConnection()->select()->from(
411-
['index_price' => $this->tableMaintainer->getMainTable($dimensions)],
413+
['index_price' => $this->tableMaintainer->getMainTableByDimensions($dimensions)],
412414
null
413415
)->where('index_price.entity_id IN (?)', $entityIds);
414416
$query = $select->deleteFromSelect('index_price');
@@ -476,7 +478,7 @@ private function getIndexTargetTableByDimension(array $dimensions)
476478
{
477479
$indexTargetTable = $this->getIndexTargetTable();
478480
if ($indexTargetTable === self::getIndexTargetTable()) {
479-
$indexTargetTable = $this->tableMaintainer->getMainTable($dimensions);
481+
$indexTargetTable = $this->tableMaintainer->getMainTableByDimensions($dimensions);
480482
}
481483
if ($indexTargetTable === self::getIndexTargetTable() . '_replica') {
482484
$indexTargetTable = $this->tableMaintainer->getMainReplicaTable($dimensions);
@@ -497,6 +499,8 @@ protected function getIndexTargetTable()
497499
}
498500

499501
/**
502+
* Get product Id field name
503+
*
500504
* @return string
501505
*/
502506
protected function getProductIdFieldName()
@@ -533,6 +537,7 @@ private function getProductsTypes(array $changedIds = [])
533537

534538
/**
535539
* Get parent products types
540+
*
536541
* Used for add composite products to reindex if we have only simple products in changed ids set
537542
*
538543
* @param array $productsIds

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ private function switchTables(): void
425425
$mainTablesByDimension = [];
426426

427427
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
428-
$mainTablesByDimension[] = $this->dimensionTableMaintainer->getMainTable($dimensions);
428+
$mainTablesByDimension[] = $this->dimensionTableMaintainer->getMainTableByDimensions($dimensions);
429429

430430
//Move data from indexers with old realisation
431431
$this->moveDataFromReplicaTableToReplicaTables($dimensions);

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

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

1616
/**
1717
* Class to prepare new tables for new indexer mode
18+
*
19+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1820
*/
1921
class ModeSwitcher implements \Magento\Indexer\Model\ModeSwitcherInterface
2022
{
@@ -98,7 +100,6 @@ public function switchMode(string $currentMode, string $previousMode)
98100
* Create new tables
99101
*
100102
* @param string $currentMode
101-
*
102103
* @return void
103104
* @throws \Zend_Db_Exception
104105
*/
@@ -116,7 +117,6 @@ public function createTables(string $currentMode)
116117
*
117118
* @param string $currentMode
118119
* @param string $previousMode
119-
*
120120
* @return void
121121
*/
122122
public function moveData(string $currentMode, string $previousMode)
@@ -125,17 +125,17 @@ public function moveData(string $currentMode, string $previousMode)
125125
$dimensionsArrayForPreviousMode = $this->getDimensionsArray($previousMode);
126126

127127
foreach ($dimensionsArrayForCurrentMode as $dimensionsForCurrentMode) {
128-
$newTable = $this->tableMaintainer->getMainTable($dimensionsForCurrentMode);
128+
$newTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForCurrentMode);
129129
if (empty($dimensionsForCurrentMode)) {
130130
// new mode is 'none'
131131
foreach ($dimensionsArrayForPreviousMode as $dimensionsForPreviousMode) {
132-
$oldTable = $this->tableMaintainer->getMainTable($dimensionsForPreviousMode);
132+
$oldTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForPreviousMode);
133133
$this->insertFromOldTablesToNew($newTable, $oldTable);
134134
}
135135
} else {
136136
// new mode is not 'none'
137137
foreach ($dimensionsArrayForPreviousMode as $dimensionsForPreviousMode) {
138-
$oldTable = $this->tableMaintainer->getMainTable($dimensionsForPreviousMode);
138+
$oldTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForPreviousMode);
139139
$this->insertFromOldTablesToNew($newTable, $oldTable, $dimensionsForCurrentMode);
140140
}
141141
}
@@ -146,7 +146,6 @@ public function moveData(string $currentMode, string $previousMode)
146146
* Drop old tables
147147
*
148148
* @param string $previousMode
149-
*
150149
* @return void
151150
*/
152151
public function dropTables(string $previousMode)
@@ -164,7 +163,6 @@ public function dropTables(string $previousMode)
164163
* Get dimensions array
165164
*
166165
* @param string $mode
167-
*
168166
* @return \Magento\Framework\Indexer\MultiDimensionProvider
169167
*/
170168
private function getDimensionsArray(string $mode): \Magento\Framework\Indexer\MultiDimensionProvider
@@ -184,7 +182,6 @@ private function getDimensionsArray(string $mode): \Magento\Framework\Indexer\Mu
184182
* @param string $newTable
185183
* @param string $oldTable
186184
* @param Dimension[] $dimensions
187-
*
188185
* @return void
189186
*/
190187
private function insertFromOldTablesToNew(string $newTable, string $oldTable, array $dimensions = [])

0 commit comments

Comments
 (0)