Skip to content

Commit e70027f

Browse files
author
Gabriel da Gama
authored
Merge branch '2.4-develop' into Fix-cron-schedule-deadlock
2 parents edd7753 + 45b2d44 commit e70027f

File tree

220 files changed

+4716
-964
lines changed

Some content is hidden

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

220 files changed

+4716
-964
lines changed

.github/stale.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 76
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 14
9+
10+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11+
onlyLabels: []
12+
13+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14+
exemptLabels:
15+
- "Priority: P0"
16+
- "Priority: P1"
17+
- "Priority: P2"
18+
- "Progress: dev in progress"
19+
- "Progress: PR in progress"
20+
- "Progress: done"
21+
- "B2B: GraphQL"
22+
- "Progress: PR Created"
23+
- "PAP"
24+
- "Project: Login as Customer"
25+
- "Project: GraphQL"
26+
27+
# Set to true to ignore issues in a project (defaults to false)
28+
exemptProjects: false
29+
30+
# Set to true to ignore issues in a milestone (defaults to false)
31+
exemptMilestones: false
32+
33+
# Set to true to ignore issues with an assignee (defaults to false)
34+
exemptAssignees: false
35+
36+
# Label to use when marking as stale
37+
staleLabel: "stale issue"
38+
39+
# Comment to post when marking as stale. Set to `false` to disable
40+
markComment: >
41+
This issue has been automatically marked as stale because it has not had
42+
recent activity. It will be closed after 14 days if no further activity occurs. Thank you
43+
for your contributions.
44+
# Comment to post when removing the stale label.
45+
# unmarkComment: >
46+
# Your comment here.
47+
48+
# Comment to post when closing a stale Issue or Pull Request.
49+
# closeComment: >
50+
# Your comment here.
51+
52+
# Limit the number of actions per hour, from 1-30. Default is 30
53+
limitPerRun: 30
54+
55+
# Limit to only `issues` or `pulls`
56+
only: issues
57+
58+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
59+
# pulls:
60+
# daysUntilStale: 30
61+
# markComment: >
62+
# This pull request has been automatically marked as stale because it has not had
63+
# recent activity. It will be closed if no further activity occurs. Thank you
64+
# for your contributions.
65+
66+
# issues:
67+
# exemptLabels:
68+
# - confirmed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

+10-8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ public function __construct(
158158
protected function initTypeModels()
159159
{
160160
$productTypes = $this->_exportConfig->getEntityTypes(CatalogProduct::ENTITY);
161+
$disabledAttrs = [];
162+
$indexValueAttributes = [];
161163
foreach ($productTypes as $productTypeName => $productTypeConfig) {
162164
if (!($model = $this->_typeFactory->create($productTypeConfig['model']))) {
163165
throw new \Magento\Framework\Exception\LocalizedException(
@@ -174,21 +176,19 @@ protected function initTypeModels()
174176
}
175177
if ($model->isSuitable()) {
176178
$this->_productTypeModels[$productTypeName] = $model;
177-
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
178-
$this->_disabledAttrs = array_merge($this->_disabledAttrs, $model->getDisabledAttrs());
179-
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
180-
$this->_indexValueAttributes = array_merge(
181-
$this->_indexValueAttributes,
182-
$model->getIndexValueAttributes()
183-
);
179+
$disabledAttrs[] = $model->getDisabledAttrs();
180+
$indexValueAttributes[] = $model->getIndexValueAttributes();
184181
}
185182
}
186183
if (!$this->_productTypeModels) {
187184
throw new \Magento\Framework\Exception\LocalizedException(
188185
__('There are no product types available for export')
189186
);
190187
}
191-
$this->_disabledAttrs = array_unique($this->_disabledAttrs);
188+
$this->_disabledAttrs = array_unique(array_merge([], $this->_disabledAttrs, ...$disabledAttrs));
189+
$this->_indexValueAttributes = array_unique(
190+
array_merge([], $this->_indexValueAttributes, ...$indexValueAttributes)
191+
);
192192
return $this;
193193
}
194194

@@ -518,6 +518,8 @@ protected function getTierPrices(array $listSku, $table)
518518
if (isset($this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP])) {
519519
$exportFilter = $this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP];
520520
}
521+
$selectFields = [];
522+
$exportData = false;
521523
if ($table == ImportAdvancedPricing::TABLE_TIER_PRICE) {
522524
$selectFields = [
523525
ImportAdvancedPricing::COL_SKU => 'cpe.sku',

app/code/Magento/AsynchronousOperations/Model/OperationProcessor.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function process(string $encodedMessage)
117117
$status = OperationInterface::STATUS_TYPE_COMPLETE;
118118
$errorCode = null;
119119
$messages = [];
120+
$entityParams = [];
120121
$topicName = $operation->getTopicName();
121122
$handlers = $this->configuration->getHandlers($topicName);
122123
try {
@@ -127,7 +128,7 @@ public function process(string $encodedMessage)
127128
$this->logger->error($e->getMessage());
128129
$status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED;
129130
$errorCode = $e->getCode();
130-
$messages[] = $e->getMessage();
131+
$messages[] = [$e->getMessage()];
131132
}
132133

133134
$outputData = null;
@@ -136,9 +137,7 @@ public function process(string $encodedMessage)
136137
$result = $this->executeHandler($callback, $entityParams);
137138
$status = $result['status'];
138139
$errorCode = $result['error_code'];
139-
// phpcs:disable Magento2.Performance.ForeachArrayMerge
140-
$messages = array_merge($messages, $result['messages']);
141-
// phpcs:enable Magento2.Performance.ForeachArrayMerge
140+
$messages[] = $result['messages'];
142141
$outputData = $result['output_data'];
143142
}
144143
}
@@ -157,7 +156,7 @@ public function process(string $encodedMessage)
157156
);
158157
$outputData = $this->jsonHelper->serialize($outputData);
159158
} catch (\Exception $e) {
160-
$messages[] = $e->getMessage();
159+
$messages[] = [$e->getMessage()];
161160
}
162161
}
163162

@@ -167,7 +166,7 @@ public function process(string $encodedMessage)
167166
$operation->getId(),
168167
$status,
169168
$errorCode,
170-
implode('; ', $messages),
169+
implode('; ', array_merge([], ...$messages)),
171170
$serializedData,
172171
$outputData
173172
);

app/code/Magento/AsynchronousOperations/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<table name="magento_operation" resource="default" engine="innodb" comment="Operation entity">
3535
<column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
3636
comment="Operation ID"/>
37-
<column xsi:type="int" name="operation_key" padding="10" unsigned="true" nullable="false"
37+
<column xsi:type="int" name="operation_key" padding="10" unsigned="true" nullable="true"
3838
comment="Operation Key"/>
3939
<column xsi:type="varbinary" name="bulk_uuid" nullable="true" length="39" comment="Related Bulk UUID"/>
4040
<column xsi:type="varchar" name="topic_name" nullable="true" length="255"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenConfigurationStoresPageActionGroup">
11+
<annotations>
12+
<description>Open configuration stores page.</description>
13+
</annotations>
14+
15+
<amOnPage url="{{AdminConfigurationStoresPage.url}}" stepKey="goToConfigurationStoresPage"/>
16+
<waitForPageLoad stepKey="waitPageLoad"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="AdminConfigurationStoresPage" url="admin/system_config/edit/section/cms/" area="admin" module="Catalog">
11+
<section name="WYSIWYGOptionsSection"/>
12+
</page>
13+
</pages>

app/code/Magento/Backend/Test/Mftf/Page/AdminConfigurationStoresPage/ConfigurationStoresPage.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<!-- @deprecated New Page was introduced. Please use "AdminConfigurationStoresPage" -->
1011
<page name="ConfigurationStoresPage" url="admin/system_config/edit/section/cms/" area="admin" module="Catalog">
1112
<section name="WYSIWYGOptionsSection"/>
1213
</page>

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

+3
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,21 @@
3535

3636
<click selector="{{AdminMenuSection.stores}}" stepKey="clickStoresMenuOption1"/>
3737
<waitForLoadingMaskToDisappear stepKey="waitForStoresMenu1" />
38+
<waitForElementVisible selector="{{AdminMenuSection.configuration}}" stepKey="waitForConfigurationVisible1"/>
3839
<click selector="{{AdminMenuSection.configuration}}" stepKey="clickStoresConfigurationMenuOption1"/>
3940
<waitForPageLoad stepKey="waitForConfigurationPageLoad1"/>
4041
<seeCurrentUrlMatches regex="~\/admin\/system_config\/~" stepKey="seeCurrentUrlMatchesConfigPath1"/>
4142

4243
<click selector="{{AdminMenuSection.catalog}}" stepKey="clickCatalogMenuOption"/>
4344
<waitForLoadingMaskToDisappear stepKey="waitForCatalogMenu1" />
45+
<waitForElementVisible selector="{{AdminMenuSection.catalogProducts}}" stepKey="waitForCatalogProductsVisible"/>
4446
<click selector="{{AdminMenuSection.catalogProducts}}" stepKey="clickCatalogProductsMenuOption"/>
4547
<waitForPageLoad stepKey="waitForProductsPageLoad"/>
4648
<seeCurrentUrlMatches regex="~\/catalog\/product\/~" stepKey="seeCurrentUrlMatchesProductsPath"/>
4749

4850
<click selector="{{AdminMenuSection.stores}}" stepKey="clickStoresMenuOption2"/>
4951
<waitForLoadingMaskToDisappear stepKey="waitForStoresMenu2" />
52+
<waitForElementVisible selector="{{AdminMenuSection.configuration}}" stepKey="waitForConfigurationVisible2"/>
5053
<click selector="{{AdminMenuSection.configuration}}" stepKey="clickStoresConfigurationMenuOption2"/>
5154
<waitForPageLoad stepKey="waitForConfigurationPageLoad2"/>
5255
<seeCurrentUrlMatches regex="~\/admin\/system_config\/~" stepKey="seeCurrentUrlMatchesConfigPath2"/>

app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ public function testGetterAmount($amountForBundle, $optionList, $expectedResult)
166166

167167
$optionSelections = [];
168168
foreach ($options as $option) {
169-
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
170-
$optionSelections = array_merge($optionSelections, $option->getSelections());
169+
$optionSelections[] = $option->getSelections();
171170
}
171+
$optionSelections = array_merge([], ...$optionSelections);
172+
172173
$this->selectionPriceListProvider->expects($this->any())->method('getPriceList')->willReturn($optionSelections);
173174

174175
$price = $this->createMock(BundleOptionPrice::class);

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -603,19 +603,15 @@ protected function populateInsertOptionValues(array $optionIds): array
603603
if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index']
604604
&& $assoc['parent_id'] == $entityId) {
605605
$option['parent_id'] = $entityId;
606-
//phpcs:ignore Magento2.Performance.ForeachArrayMerge
607-
$optionValues = array_merge(
608-
$optionValues,
609-
$this->populateOptionValueTemplate($option, $optionId)
610-
);
606+
$optionValues[] = $this->populateOptionValueTemplate($option, $optionId);
611607
$this->_cachedOptions[$entityId][$key]['option_id'] = $optionId;
612608
break;
613609
}
614610
}
615611
}
616612
}
617613

618-
return $optionValues;
614+
return array_merge([], ...$optionValues);
619615
}
620616

621617
/**

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
class Validate extends AttributeAction implements HttpGetActionInterface, HttpPostActionInterface
3434
{
3535
const DEFAULT_MESSAGE_KEY = 'message';
36+
private const RESERVED_ATTRIBUTE_CODES = ['product_type', 'type_id'];
3637

3738
/**
3839
* @var JsonFactory
@@ -145,11 +146,16 @@ public function execute()
145146
);
146147
}
147148

148-
if ($attribute->getId() && !$attributeId || $attributeCode === 'product_type' || $attributeCode === 'type_id') {
149+
if (in_array($attributeCode, self::RESERVED_ATTRIBUTE_CODES, true)) {
150+
$message = __('Code (%1) is a reserved key and cannot be used as attribute code.', $attributeCode);
151+
$this->setMessageToResponse($response, [$message]);
152+
$response->setError(true);
153+
}
154+
155+
if ($attribute->getId() && !$attributeId) {
149156
$message = strlen($this->getRequest()->getParam('attribute_code'))
150157
? __('An attribute with this code already exists.')
151158
: __('An attribute with the same code (%1) already exists.', $attributeCode);
152-
153159
$this->setMessageToResponse($response, [$message]);
154160

155161
$response->setError(true);

0 commit comments

Comments
 (0)