Skip to content

Commit 3f87a5b

Browse files
authored
Merge branch '2.4-develop' into bugfix/invalid-code-generated
2 parents fcc3e27 + f3a160c commit 3f87a5b

File tree

3,926 files changed

+19002
-245355
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,926 files changed

+19002
-245355
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')

app/code/Magento/AdvancedSearch/Model/Client/ClientResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*/
66
namespace Magento\AdvancedSearch\Model\Client;
77

8-
use \Magento\Framework\ObjectManagerInterface;
8+
use Magento\Framework\ObjectManagerInterface;
99
use Magento\Framework\Search\EngineResolverInterface;
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
1011

1112
/**
1213
* @api
@@ -46,7 +47,7 @@ class ClientResolver
4647
private $clientOptionsPool;
4748

4849
/**
49-
* @var EngineResolver
50+
* @var EngineResolverInterface
5051
*/
5152
private $engineResolver;
5253

app/code/Magento/AdvancedSearch/Model/Indexer/Fulltext/Plugin/CustomerGroup.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Magento\Framework\Model\AbstractModel;
1313
use Magento\Catalog\Model\ResourceModel\Attribute;
1414
use Magento\AdvancedSearch\Model\Client\ClientOptionsInterface;
15-
use Magento\Framework\Search\EngineResolverInterface;
16-
use Magento\Search\Model\EngineResolver;
1715

1816
class CustomerGroup extends AbstractPlugin
1917
{
@@ -22,24 +20,16 @@ class CustomerGroup extends AbstractPlugin
2220
*/
2321
protected $clientOptions;
2422

25-
/**
26-
* @var EngineResolverInterface
27-
*/
28-
protected $engineResolver;
29-
3023
/**
3124
* @param IndexerRegistry $indexerRegistry
3225
* @param ClientOptionsInterface $clientOptions
33-
* @param EngineResolverInterface $engineResolver
3426
*/
3527
public function __construct(
3628
IndexerRegistry $indexerRegistry,
37-
ClientOptionsInterface $clientOptions,
38-
EngineResolverInterface $engineResolver
29+
ClientOptionsInterface $clientOptions
3930
) {
4031
parent::__construct($indexerRegistry);
4132
$this->clientOptions = $clientOptions;
42-
$this->engineResolver = $engineResolver;
4333
}
4434

4535
/**
@@ -56,9 +46,7 @@ public function aroundSave(
5646
\Closure $proceed,
5747
AbstractModel $group
5848
) {
59-
$needInvalidation =
60-
($this->engineResolver->getCurrentSearchEngine() != EngineResolver::CATALOG_SEARCH_MYSQL_ENGINE)
61-
&& ($group->isObjectNew() || $group->dataHasChangedFor('tax_class_id'));
49+
$needInvalidation = $group->isObjectNew() || $group->dataHasChangedFor('tax_class_id');
6250
$result = $proceed($group);
6351
if ($needInvalidation) {
6452
$this->indexerRegistry->get(Fulltext::INDEXER_ID)->invalidate();

app/code/Magento/AdvancedSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/CustomerGroupTest.php

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use Magento\Customer\Model\ResourceModel\Group as CustomerGroupResourceModel;
1515
use Magento\Framework\Indexer\IndexerInterface;
1616
use Magento\Framework\Indexer\IndexerRegistry;
17-
use Magento\Framework\Search\EngineResolverInterface;
1817
use PHPUnit\Framework\TestCase;
18+
use PHPUnit\Framework\MockObject\MockObject;
1919

2020
/**
2121
* @covers \Magento\AdvancedSearch\Model\Indexer\Fulltext\Plugin\CustomerGroup
@@ -35,7 +35,7 @@ class CustomerGroupTest extends TestCase
3535
private $indexerMock;
3636

3737
/**
38-
* @var Group|MockObject
38+
* @var CustomerGroupResourceModel|MockObject
3939
*/
4040
private $subjectMock;
4141

@@ -49,11 +49,6 @@ class CustomerGroupTest extends TestCase
4949
*/
5050
private $indexerRegistryMock;
5151

52-
/**
53-
* @var EngineResolverInterface|MockObject
54-
*/
55-
private $engineResolverMock;
56-
5752
protected function setUp(): void
5853
{
5954
$this->subjectMock = $this->createMock(CustomerGroupResourceModel::class);
@@ -73,35 +68,24 @@ protected function setUp(): void
7368
IndexerRegistry::class,
7469
['get']
7570
);
76-
$this->engineResolverMock = $this->createPartialMock(
77-
EngineResolverInterface::class,
78-
['getCurrentSearchEngine']
79-
);
8071
$this->model = new CustomerGroupPlugin(
8172
$this->indexerRegistryMock,
82-
$this->customerOptionsMock,
83-
$this->engineResolverMock
73+
$this->customerOptionsMock
8474
);
8575
}
8676

8777
/**
88-
* @param string $searchEngine
8978
* @param bool $isObjectNew
9079
* @param bool $isTaxClassIdChanged
9180
* @param int $invalidateCounter
9281
* @return void
9382
* @dataProvider aroundSaveDataProvider
9483
*/
9584
public function testAroundSave(
96-
string $searchEngine,
9785
bool $isObjectNew,
9886
bool $isTaxClassIdChanged,
9987
int $invalidateCounter
10088
): void {
101-
$this->engineResolverMock->expects($this->once())
102-
->method('getCurrentSearchEngine')
103-
->willReturn($searchEngine);
104-
10589
$groupMock = $this->createPartialMock(
10690
CustomerGroupModel::class,
10791
['dataHasChangedFor', 'isObjectNew', '__wakeup']
@@ -137,14 +121,10 @@ public function testAroundSave(
137121
public function aroundSaveDataProvider(): array
138122
{
139123
return [
140-
['mysql', false, false, 0],
141-
['mysql', false, true, 0],
142-
['mysql', true, false, 0],
143-
['mysql', true, true, 0],
144-
['custom', false, false, 0],
145-
['custom', false, true, 1],
146-
['custom', true, false, 1],
147-
['custom', true, true, 1],
124+
[false, false, 0],
125+
[false, true, 1],
126+
[true, false, 1],
127+
[true, true, 1],
148128
];
149129
}
150130
}
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/Backend/etc/adminhtml/system.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
</group>
342342
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
343343
<label>Images Upload Configuration</label>
344-
<field id="enable_resize" translate="label" type="select" sortOrder="200" showInDefault="1" canRestore="1">
344+
<field id="enable_resize" translate="label comment" type="select" sortOrder="200" showInDefault="1" canRestore="1">
345345
<label>Enable Frontend Resize</label>
346346
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
347347
<comment>Resize performed via javascript before file upload.</comment>
@@ -459,9 +459,7 @@
459459
<label>Add Store Code to Urls</label>
460460
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
461461
<backend_model>Magento\Config\Model\Config\Backend\Store</backend_model>
462-
<comment>
463-
<![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).]]>
464-
</comment>
462+
<comment><![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).]]></comment>
465463
</field>
466464
<field id="redirect_to_base" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
467465
<label>Auto-redirect to Base URL</label>

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,9 @@ Security,Security
403403
Web,Web
404404
"Url Options","Url Options"
405405
"Add Store Code to Urls","Add Store Code to Urls"
406-
"
407-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
408-
","
409-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
410-
"
406+
"<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).","<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.)."
407+
"Enable Frontend Resize","Enable Frontend Resize"
408+
"Resize performed via javascript before file upload.","Resize performed via javascript before file upload."
411409
"Auto-redirect to Base URL","Auto-redirect to Base URL"
412410
"Search Engine Optimization","Search Engine Optimization"
413411
"Use Web Server Rewrites","Use Web Server Rewrites"

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/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<group value="Bundle"/>
2020
<group value="SearchEngineElasticsearch"/>
2121
<skip>
22-
<issueId value="MC-21228"/>
22+
<issueId value="MC-34217"/>
2323
</skip>
2424
</annotations>
2525
<before>

0 commit comments

Comments
 (0)