Skip to content

Commit 46dcbd3

Browse files
merge magento-commerce/2.4-develop into magento-performance/MCP-996
2 parents 884dcc0 + b092dd6 commit 46dcbd3

File tree

174 files changed

+5155
-1202
lines changed

Some content is hidden

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

174 files changed

+5155
-1202
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Technical issue with the Magento 2 core components
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please read [our guidelines](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report-an-issue) before submitting the issue.
8+
- type: textarea
9+
attributes:
10+
label: Preconditions and environment
11+
description: |
12+
Describe your environment.
13+
Provide all the details that will help us to reproduce the bug.
14+
value: |
15+
- Magento version
16+
- Anything else that would help a developer reproduce the bug
17+
- type: textarea
18+
attributes:
19+
label: Steps to reproduce
20+
description: |
21+
Provide a set of clear steps to reproduce this bug.
22+
placeholder: |
23+
Example:
24+
1. Navigate to storefront as a guest.
25+
2. Open Test Category.
26+
3. Click “Add to Cart” on the Virtual Product.
27+
4. Open mini shopping cart and click “Proceed to Checkout”.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Expected result
33+
description: |
34+
Tell us what you expected to happen.
35+
placeholder: |
36+
Example:
37+
Order is placed successfully, customer is redirected to the success page.
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Actual result
43+
description: |
44+
Tell us what happened. Include error messages and issues.
45+
placeholder: |
46+
Example:
47+
“Place order” button is not visible, order cannot be placed.
48+
validations:
49+
required: true
50+
- type: textarea
51+
attributes:
52+
label: Additional information
53+
description: |
54+
Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
55+
Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections.
56+
- type: textarea
57+
attributes:
58+
label: Release note
59+
description: |
60+
Help us to provide meaningful release notes to the community.
61+
- type: checkboxes
62+
attributes:
63+
label: Triage and priority
64+
description: |
65+
Provide [Severity](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#community-backlog-priority) assessment for the Issue as a Reporter.
66+
This information helps us during the Confirmation and Issue triage processes.
67+
options:
68+
- label: 'Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._'
69+
- label: 'Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._'
70+
- label: 'Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._'
71+
- label: 'Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._'
72+
- label: 'Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Magento values the contributions of the security research community, and we look
44

55
## Where should I report security issues?
66

7-
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/magento). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
7+
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/adobe). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
88

99
## Learning More About Security
1010
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).

app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export/GetFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function execute()
3434
/** @var $export \Magento\ImportExport\Model\Export */
3535
$export = $this->_objectManager->create(\Magento\ImportExport\Model\Export::class);
3636
$export->setData($data);
37-
$export->filterAttributeCollection(
38-
$attrFilterBlock->prepareCollection($export->getEntityAttributeCollection())
37+
$attrFilterBlock->prepareCollection(
38+
$export->filterAttributeCollection($export->getEntityAttributeCollection())
3939
);
4040
return $resultLayout;
4141
} catch (\Exception $e) {

app/code/Magento/AdvancedSearch/view/frontend/templates/search_data.phtml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66

77
/**
88
* @var \Magento\AdvancedSearch\Block\SearchData $block
9+
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
910
*/
1011
?>
1112
<?php
1213
/** @var \Magento\Search\Model\QueryResult[] $data */
1314
$data = $block->getItems();
14-
if (count($data)) : ?>
15+
if (count($data)): ?>
1516
<dl class="block">
1617
<dt class="title"><?= $block->escapeHtml(__($block->getTitle())) ?></dt>
17-
<?php foreach ($data as $additionalInfo) : ?>
18+
<?php foreach ($data as $additionalInfo): ?>
1819
<dd class="item">
1920
<a href="<?= $block->escapeUrl($block->getLink($additionalInfo->getQueryText())) ?>"
2021
><?= $block->escapeHtml($additionalInfo->getQueryText()) ?></a>
21-
<?php if ($block->isShowResultsCount()) : ?>
22-
<span class="count"><?= /* @noEscape */ (int)$additionalInfo->getResultsCount() ?></span>
22+
<?php if ($block->isShowResultsCount()): ?>
23+
<span class="count">
24+
<?= /* @noEscape */ $localeFormatter->formatNumber((int)$additionalInfo->getResultsCount()) ?>
25+
</span>
2326
<?php endif; ?>
2427
</dd>
2528
<?php endforeach; ?>

app/code/Magento/Backend/Controller/Adminhtml/Ajax/Translate.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Ajax;
88

9+
use Magento\Framework\App\Action\HttpPostActionInterface;
910
use Magento\Backend\App\Action;
1011

11-
class Translate extends \Magento\Backend\App\Action
12+
class Translate extends \Magento\Backend\App\Action implements HttpPostActionInterface
1213
{
1314
/**
1415
* @var \Magento\Framework\Translate\Inline\ParserInterface
@@ -23,7 +24,7 @@ class Translate extends \Magento\Backend\App\Action
2324
/**
2425
* Authorization level of a basic admin session
2526
*/
26-
const ADMIN_RESOURCE = 'Magento_Backend::content_translation';
27+
public const ADMIN_RESOURCE = 'Magento_Backend::content_translation';
2728

2829
/**
2930
* @param Action\Context $context
@@ -52,8 +53,7 @@ public function execute()
5253
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
5354
$resultJson = $this->resultJsonFactory->create();
5455
try {
55-
$this->inlineParser->processAjaxPost($translate);
56-
$response = ['success' => 'true'];
56+
$response = $this->inlineParser->processAjaxPost($translate);
5757
} catch (\Exception $e) {
5858
$response = ['error' => 'true', 'message' => $e->getMessage()];
5959
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Plugin\Framework\Data\Form\Element;
9+
10+
use Magento\Framework\Data\Form\Element\AbstractElement;
11+
use Magento\Framework\Data\Form\Element\Fieldset;
12+
13+
/**
14+
* Plugin that fixes mapping of value and label for bundle dynamic attributes
15+
*/
16+
class FieldsetPlugin
17+
{
18+
/**
19+
* @var string[]
20+
*/
21+
private $dynamicAttributeNames = ['sku_type', 'weight_type', 'price_type'];
22+
23+
/**
24+
* Normalise bundle dynamic attributes values
25+
*
26+
* Normalise attribute values for bundle dynamic attributes generated by form element
27+
* to make it consistent across the system (dynamic => 1, fixed => 0)
28+
*
29+
* @param Fieldset $subject
30+
* @param AbstractElement $result
31+
* @return AbstractElement
32+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
33+
*/
34+
public function afterAddField(Fieldset $subject, AbstractElement $result)
35+
{
36+
if (!in_array($result->getAttributeCode(), $this->dynamicAttributeNames)) {
37+
return $result;
38+
}
39+
40+
$new = [];
41+
foreach ($result->getValues() as $option) {
42+
$option['value'] = (int)!$option['value'];
43+
$new[] = $option;
44+
}
45+
46+
$result->setValues($new);
47+
return $result;
48+
}
49+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Test\Fixture;
9+
10+
use Magento\Framework\DataObject;
11+
use Magento\Sales\Api\OrderRepositoryInterface;
12+
use Magento\TestFramework\Fixture\Api\DataMerger;
13+
use Magento\TestFramework\Fixture\Api\ServiceFactory;
14+
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
15+
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
16+
17+
class OrderItem implements RevertibleDataFixtureInterface
18+
{
19+
private const DEFAULT_DATA = [
20+
'items' => [
21+
['sku' => '%uniqid%']
22+
],
23+
'payment'=> [ 'method' => 'checkmo']
24+
];
25+
26+
/**
27+
* @var ServiceFactory
28+
*/
29+
private ServiceFactory $serviceFactory;
30+
31+
/**
32+
* @var ProcessorInterface
33+
*/
34+
private ProcessorInterface $dataProcessor;
35+
36+
/**
37+
* @var DataMerger
38+
*/
39+
private DataMerger $dataMerger;
40+
41+
/**
42+
* @param ServiceFactory $serviceFactory
43+
* @param ProcessorInterface $dataProcessor
44+
* @param DataMerger $dataMerger
45+
*/
46+
public function __construct(
47+
ServiceFactory $serviceFactory,
48+
ProcessorInterface $dataProcessor,
49+
DataMerger $dataMerger
50+
) {
51+
$this->serviceFactory = $serviceFactory;
52+
$this->dataProcessor = $dataProcessor;
53+
$this->dataMerger = $dataMerger;
54+
}
55+
56+
/**
57+
* @param array $data
58+
* @return DataObject|null
59+
*/
60+
public function apply(array $data = []): ?DataObject
61+
{
62+
$service = $this->serviceFactory->create(OrderRepositoryInterface::class, 'save');
63+
64+
return $service->execute(['entity' => $this->prepareData($data)]);
65+
}
66+
67+
/**
68+
* @inheritdoc
69+
*/
70+
public function revert(DataObject $data): void
71+
{
72+
$service = $this->serviceFactory->create(OrderRepositoryInterface::class, 'delete');
73+
74+
$service->execute(['entity' => $data]);
75+
}
76+
77+
/**
78+
* Prepare product data
79+
*
80+
* @param array $data
81+
* @return array
82+
*/
83+
private function prepareData(array $data): array
84+
{
85+
$data = $this->dataMerger->merge(self::DEFAULT_DATA, $data, false);
86+
87+
return $this->dataProcessor->process($this, $data);
88+
}
89+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminAssertBundleDynamicAttributesOnProductEditPageActionGroup">
12+
<annotations>
13+
<description>Verifies bundle dynamic attributes on the Product Edit page in admin.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="dynamicSku" defaultValue="true" type="string"/>
17+
<argument name="dynamicPrice" defaultValue="true" type="string"/>
18+
<argument name="dynamicWeight" defaultValue="true" type="string"/>
19+
</arguments>
20+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicSkuInput}}&quot;).checked.toString()" stepKey="dynamicSkuCheckedValue"/>
21+
<assertEquals stepKey="assertDynamicSku">
22+
<actualResult type="variable">dynamicSkuCheckedValue</actualResult>
23+
<expectedResult type="string">{{dynamicSku}}</expectedResult>
24+
</assertEquals>
25+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicPriceInput}}&quot;).checked.toString()" stepKey="dynamicPriceCheckedValue"/>
26+
<assertEquals stepKey="assertDynamicPrice">
27+
<actualResult type="variable">dynamicPriceCheckedValue</actualResult>
28+
<expectedResult type="string">{{dynamicPrice}}</expectedResult>
29+
</assertEquals>
30+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicWeightInput}}&quot;).checked.toString()" stepKey="dynamicWeightCheckedValue"/>
31+
<assertEquals stepKey="assertDynamicWeight">
32+
<actualResult type="variable">dynamicWeightCheckedValue</actualResult>
33+
<expectedResult type="string">{{dynamicWeight}}</expectedResult>
34+
</assertEquals>
35+
</actionGroup>
36+
</actionGroups>

0 commit comments

Comments
 (0)