Skip to content

Commit 36ad44e

Browse files
authored
Merge branch '2.4-develop' into no-author/customer-01
2 parents 97af6ba + e6e2dc3 commit 36ad44e

File tree

243 files changed

+5427
-571
lines changed

Some content is hidden

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

243 files changed

+5427
-571
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For more detailed information on contribution please read our [beginners guide](
1515

1616
## Contribution requirements
1717

18-
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
18+
1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
1919
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
2020
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
2121
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ However, for those who need a full-featured eCommerce solution, we recommend [Ad
2626

2727
## Contribute
2828

29-
Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://devdocs.magento.com/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.
29+
Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://developer.adobe.com/commerce/docs/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.
3030

3131
- [Contribute to the code](https://developer.adobe.com/commerce/contributor/guides/code-contributions/)
3232
- [Report an issue](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report)
@@ -36,7 +36,7 @@ Our [Community](https://opensource.magento.com/) is large and diverse, and our p
3636

3737
### Maintainers
3838

39-
We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.
39+
We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.
4040

4141
- [Learn more about the Maintainer role](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
4242
- [Maintainer's Handbook](https://developer.adobe.com/commerce/contributor/guides/maintainers/handbook/)
@@ -64,9 +64,9 @@ Stay up-to-date on the latest security news and patches by signing up for [Secur
6464
## Licensing
6565

6666
Each Magento source file included in this distribution is licensed under OSL 3.0 or the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento).
67-
67+
6868
[Open Software License (OSL 3.0)](https://opensource.org/licenses/osl-3.0.php) – Please see [LICENSE.txt](LICENSE.txt) for the full text of the OSL 3.0 license.
69-
69+
7070
Subject to Licensee's/Customer's payment of fees and compliance with the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento), the terms and conditions of the applicable ordering between Licensee/Customer and Adobe (or Magento) supersede the OSL 3.0 license for each source file.
7171

7272
## Communications

app/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80100) {
1818
if (PHP_SAPI == 'cli') {
1919
echo 'Magento supports PHP 8.1.0 or later. ' .
20-
'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html';
20+
'Please read https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html';
2121
} else {
2222
echo <<<HTML
2323
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
2424
<p>Magento supports PHP 8.1.0 or later. Please read
25-
<a target="_blank" href="https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html">
25+
<a target="_blank" href="https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html">
2626
Magento System Requirements</a>.
2727
</div>
2828
HTML;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The Magento\AdminAnalytics module gathers information about the features Magento administrators use. This information will be used to help improve the user experience on the Magento Admin.
1+
The Magento\AdminAnalytics module gathers information about the features Magento administrators use. This information will be used to help improve the user experience on the Magento Admin.

app/code/Magento/AwsS3/Driver/AwsS3.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function deleteDirectory($path): bool
257257
/**
258258
* @inheritDoc
259259
*/
260-
public function filePutContents($path, $content, $mode = null): int
260+
public function filePutContents($path, $content, $mode = null): bool|int
261261
{
262262
$path = $this->normalizeRelativePath($path, true);
263263
$config = self::CONFIG;
@@ -272,10 +272,11 @@ public function filePutContents($path, $content, $mode = null): int
272272

273273
try {
274274
$this->adapter->write($path, $content, new Config($config));
275-
return $this->adapter->fileSize($path)->fileSize();
275+
return ($this->adapter->fileSize($path)->fileSize() !== null)??true;
276+
276277
} catch (FlysystemFilesystemException | UnableToRetrieveMetadata $e) {
277278
$this->logger->error($e->getMessage());
278-
return 0;
279+
return false;
279280
}
280281
}
281282

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAwsS3SyncZeroByteFilesTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="zero byte files are synced"/>
15+
<title value="S3 - Verify zero byte files are synced"/>
16+
<description value="Verifies that zero byte files are synced to AWS S3 with error."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-8252"/>
19+
<useCaseId value="ACP2E-1608"/>
20+
<group value="remote_storage_aws_s3"/>
21+
<group value="skip_in_cloud_native_s3"/>
22+
<group value="remote_storage_disabled"/>
23+
</annotations>
24+
25+
<before>
26+
<!-- Enable AWS S3 Remote Storage & Sync -->
27+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
28+
<!-- Copy Images to Import Directory for Product Images -->
29+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProductBaseImage">
30+
<argument name="source">dev/tests/acceptance/tests/_data/empty.jpg</argument>
31+
<argument name="destination">pub/media/empty.jpg</argument>
32+
</helper>
33+
</before>
34+
35+
<after>
36+
<!-- Delete Images on Local File System -->
37+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage">
38+
<argument name="filePath">pub/media/empty.jpg</argument>
39+
</helper>
40+
<!-- Delete Images on S3 System -->
41+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteFileIfExists" stepKey="deleteS3Image">
42+
<argument name="filePath">pub/media/empty.jpg</argument>
43+
</helper>
44+
<!-- Disable AWS S3 Remote Storage -->
45+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
46+
</after>
47+
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/>
48+
<assertEquals stepKey="assertConfigTest">
49+
<expectedResult type="string">Uploading media files to remote storage.\n- empty.jpg\nEnd of upload.</expectedResult>
50+
<actualResult type="variable">$syncRemoteStorage</actualResult>
51+
</assertEquals>
52+
53+
</test>
54+
</tests>

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,16 @@ public function getHtml()
109109
' value="' .
110110
$this->localeResolver->getLocale() .
111111
'"/>';
112-
$scriptString = '
113-
require(["jquery", "mage/calendar"], function($){
114-
$("#' .
115-
$htmlId .
116-
'_range").dateRange({
117-
dateFormat: "' .
118-
$format .
119-
'",
120-
buttonText: "' . $this->escapeHtml(__('Date selector')) .
121-
'",
112+
$scriptString = 'require(["jquery", "mage/calendar"], function($){
113+
$("#' . $htmlId . '_range").dateRange({
114+
dateFormat: "' . $format . '",
115+
buttonText: "' . $this->escapeHtml(__('Date selector')) . '",
116+
buttonImage: "' . $this->getViewFileUrl('Magento_Theme::calendar.png') . '",
122117
from: {
123-
id: "' .
124-
$htmlId .
125-
'_from"
118+
id: "' . $htmlId . '_from"
126119
},
127120
to: {
128-
id: "' .
129-
$htmlId .
130-
'_to"
121+
id: "' . $htmlId . '_to"
131122
}
132123
})
133124
});';

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Datetime extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Date
1717
/**
1818
* full day is 86400, we need 23 hours:59 minutes:59 seconds = 86399
1919
*/
20-
const END_OF_DAY_IN_SECONDS = 86399;
20+
public const END_OF_DAY_IN_SECONDS = 86399;
2121

2222
/**
2323
* @inheritdoc
@@ -123,6 +123,7 @@ public function getHtml()
123123
timeFormat: "' . $timeFormat . '",
124124
showsTime: ' . ($this->getColumn()->getFilterTime() ? 'true' : 'false') . ',
125125
buttonText: "' . $this->escapeHtml(__('Date selector')) . '",
126+
buttonImage: "' . $this->getViewFileUrl('Magento_Theme::calendar.png') . '",
126127
from: {
127128
id: "' . $htmlId . '_from"
128129
},

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
* @api
1717
* @deprecated 100.2.0 in favour of UI component implementation
18+
* @see don't recommend this approach in favour of UI component implementation
1819
* @since 100.0.2
1920
*/
2021
class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Text
@@ -132,14 +133,16 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
132133
}
133134

134135
if (empty($action['id'])) {
135-
$action['id'] = 'id' .$this->random->getRandomString(10);
136+
$action['id'] = 'id' . $this->random->getRandomString(10);
136137
}
137138
$actionAttributes->setData($action);
138139
$onclick = $actionAttributes->getData('onclick');
139140
$style = $actionAttributes->getData('style');
140141
$actionAttributes->unsetData(['onclick', 'style']);
141142
$html = '<a ' . $actionAttributes->serialize() . '>' . $actionCaption . '</a>';
142143
if ($onclick) {
144+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
145+
$onclick = html_entity_decode($onclick);
143146
$html .= $this->secureHtmlRenderer->renderEventListenerAsTag('onclick', $onclick, "#{$action['id']}");
144147
}
145148
if ($style) {

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DateTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@
1010
use Magento\Backend\Block\Context;
1111
use Magento\Backend\Block\Widget\Grid\Column;
1212
use Magento\Backend\Block\Widget\Grid\Column\Filter\Date;
13+
use Magento\Framework\App\Request\Http;
1314
use Magento\Framework\Escaper;
1415
use Magento\Framework\Locale\ResolverInterface;
1516
use Magento\Framework\Math\Random;
1617
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
1718
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1819
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
20+
use Magento\Framework\View\Asset\Repository;
1921
use PHPUnit\Framework\MockObject\MockObject;
2022
use PHPUnit\Framework\TestCase;
2123

2224
/**
2325
* Class DateTest to test Magento\Backend\Block\Widget\Grid\Column\Filter\Date
2426
*
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2528
*/
2629
class DateTest extends TestCase
2730
{
@@ -49,6 +52,16 @@ class DateTest extends TestCase
4952
/** @var Context|MockObject */
5053
private $contextMock;
5154

55+
/**
56+
* @var Http|MockObject
57+
*/
58+
private $request;
59+
60+
/**
61+
* @var Repository|MockObject
62+
*/
63+
private $repositoryMock;
64+
5265
protected function setUp(): void
5366
{
5467
$this->mathRandomMock = $this->getMockBuilder(Random::class)
@@ -88,6 +101,23 @@ protected function setUp(): void
88101
$this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock);
89102
$this->contextMock->expects($this->once())->method('getLocaleDate')->willReturn($this->localeDateMock);
90103

104+
$this->request = $this->getMockBuilder(Http::class)
105+
->disableOriginalConstructor()
106+
->getMock();
107+
108+
$this->contextMock->expects($this->once())
109+
->method('getRequest')
110+
->willReturn($this->request);
111+
112+
$this->repositoryMock = $this->getMockBuilder(Repository::class)
113+
->disableOriginalConstructor()
114+
->setMethods(['getUrlWithParams'])
115+
->getMock();
116+
117+
$this->contextMock->expects($this->once())
118+
->method('getAssetRepository')
119+
->willReturn($this->repositoryMock);
120+
91121
$objectManagerHelper = new ObjectManager($this);
92122
$this->model = $objectManagerHelper->getObject(
93123
Date::class,
@@ -116,6 +146,14 @@ public function testGetHtmlSuccessfulTimestamp()
116146
'from' => $yesterday->getTimestamp(),
117147
'to' => $tomorrow->getTimestamp()
118148
];
149+
$params = ['_secure' => false];
150+
$fileId = 'Magento_Theme::calendar.png';
151+
$fileUrl = 'file url';
152+
153+
$this->repositoryMock->expects($this->once())
154+
->method('getUrlWithParams')
155+
->with($fileId, $params)
156+
->willReturn($fileUrl);
119157

120158
$this->mathRandomMock->expects($this->any())->method('getUniqueHash')->willReturn($uniqueHash);
121159
$this->columnMock->expects($this->once())->method('getHtmlId')->willReturn($id);

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010
use Magento\Backend\Block\Context;
1111
use Magento\Backend\Block\Widget\Grid\Column;
1212
use Magento\Backend\Block\Widget\Grid\Column\Filter\Datetime;
13+
use Magento\Framework\App\Request\Http;
1314
use Magento\Framework\Escaper;
1415
use Magento\Framework\Locale\ResolverInterface;
1516
use Magento\Framework\Math\Random;
1617
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
1718
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1819
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
20+
use Magento\Framework\View\Asset\Repository;
1921
use PHPUnit\Framework\MockObject\MockObject;
2022
use PHPUnit\Framework\TestCase;
2123

2224
/**
2325
* Class DateTimeTest to test Magento\Backend\Block\Widget\Grid\Column\Filter\Date
26+
*
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2428
*/
2529
class DatetimeTest extends TestCase
2630
{
@@ -48,6 +52,16 @@ class DatetimeTest extends TestCase
4852
/** @var Context|MockObject */
4953
private $contextMock;
5054

55+
/**
56+
* @var Http|MockObject
57+
*/
58+
private $request;
59+
60+
/**
61+
* @var Repository|MockObject
62+
*/
63+
private $repositoryMock;
64+
5165
protected function setUp(): void
5266
{
5367
$this->mathRandomMock = $this->getMockBuilder(Random::class)
@@ -87,6 +101,23 @@ protected function setUp(): void
87101
$this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock);
88102
$this->contextMock->expects($this->once())->method('getLocaleDate')->willReturn($this->localeDateMock);
89103

104+
$this->request = $this->getMockBuilder(Http::class)
105+
->disableOriginalConstructor()
106+
->getMock();
107+
108+
$this->contextMock->expects($this->once())
109+
->method('getRequest')
110+
->willReturn($this->request);
111+
112+
$this->repositoryMock = $this->getMockBuilder(Repository::class)
113+
->disableOriginalConstructor()
114+
->setMethods(['getUrlWithParams'])
115+
->getMock();
116+
117+
$this->contextMock->expects($this->once())
118+
->method('getAssetRepository')
119+
->willReturn($this->repositoryMock);
120+
90121
$objectManagerHelper = new ObjectManager($this);
91122
$this->model = $objectManagerHelper->getObject(
92123
Datetime::class,
@@ -115,6 +146,14 @@ public function testGetHtmlSuccessfulTimestamp()
115146
'from' => $yesterday->getTimestamp(),
116147
'to' => $tomorrow->getTimestamp()
117148
];
149+
$params = ['_secure' => false];
150+
$fileId = 'Magento_Theme::calendar.png';
151+
$fileUrl = 'file url';
152+
153+
$this->repositoryMock->expects($this->once())
154+
->method('getUrlWithParams')
155+
->with($fileId, $params)
156+
->willReturn($fileUrl);
118157

119158
$this->mathRandomMock->expects($this->any())->method('getUniqueHash')->willReturn($uniqueHash);
120159
$this->columnMock->expects($this->once())->method('getHtmlId')->willReturn($id);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
The CacheInvalidate module is used to invalidate the Varnish cache if it is configured.
2-
It listens for events that request the cache to be flushed or cause the cache to be invalid, then sends Varnish a purge request using cURL.
2+
It listens for events that request the cache to be flushed or cause the cache to be invalid, then sends Varnish a purge request using cURL.

app/code/Magento/Captcha/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The Captcha module allows applying Turing test in the process of user authentication or similar tasks.
1+
The Captcha module allows applying Turing test in the process of user authentication or similar tasks.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The CardinalCommerce module provides a possibility to enable 3-D Secure 2.0 support for payment methods.
1+
The CardinalCommerce module provides a possibility to enable 3-D Secure 2.0 support for payment methods.

0 commit comments

Comments
 (0)