Skip to content

Commit 9eba2c1

Browse files
authored
Merge branch '2.4-develop' into add-StorefrontCheckRefundHGrandTotalActionGroup
2 parents 0919deb + 9ff22de commit 9eba2c1

File tree

710 files changed

+11036
-11892
lines changed

Some content is hidden

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

710 files changed

+11036
-11892
lines changed

Gruntfile.js.sample

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ module.exports = function (grunt) {
1616
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
1717
themes;
1818

19-
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20-
themes = filesRouter.get('themes');
19+
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20+
themes = filesRouter.get('themes');
2121

22-
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
22+
tasks = _.map(tasks, function (task) {
23+
return task.replace('.js', '');
24+
});
2325
tasks.push('time-grunt');
2426
tasks.forEach(function (task) {
2527
require(task)(grunt);
@@ -50,10 +52,9 @@ module.exports = function (grunt) {
5052
prod: function (component) {
5153
var tasks = [
5254
'less',
53-
'autoprefixer',
5455
'cssmin',
5556
'usebanner'
56-
].map(function(task){
57+
].map(function (task) {
5758
return task + ':' + component;
5859
});
5960

@@ -72,7 +73,7 @@ module.exports = function (grunt) {
7273
'clean',
7374
'exec:all'
7475
];
75-
_.each(themes, function(theme, name) {
76+
_.each(themes, function (theme, name) {
7677
tasks.push('less:' + name);
7778
});
7879
grunt.task.run(tasks);

app/bootstrap.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
exit(1);
3131
}
3232

33+
// PHP 8 compatibility. Define constants that are not present in PHP < 8.0
34+
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80000) {
35+
if (!defined('T_NAME_QUALIFIED')) {
36+
define('T_NAME_QUALIFIED', 24001);
37+
}
38+
if (!defined('T_NAME_FULLY_QUALIFIED')) {
39+
define('T_NAME_FULLY_QUALIFIED', 24002);
40+
}
41+
}
42+
3343
require_once __DIR__ . '/autoload.php';
3444
// Sets default autoload mappings, may be overridden in Bootstrap::create
3545
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);

app/code/Magento/AdminAnalytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.3.0||~7.4.0",
8+
"php": "~7.4.0||~8.0.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-config": "*",

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.3.0||~7.4.0",
8+
"php": "~7.4.0||~8.0.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/listing.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
<div class="message-system-short">
1010
<button class="message-system-action-dropdown" toggleCollapsible>
1111
<span>
12-
<translate args="'System Messages'"/>:
13-
<text args="totalRecords"/>
12+
<translate args="'System Messages'"></translate>:
13+
<text args="totalRecords"></text>
1414
</span>
1515
</button>
1616
<div class="message-system-short-wrapper" if="rows[0]" repeat="foreach: [rows[0]], item: '$row'" visible="!$collapsible.opened()">
1717
<fastForEach args="data: getVisible(), as: '$col'" >
18-
<render args="$col.getBody()"/>
18+
<render args="$col.getBody()"></render>
1919
</fastForEach>
2020
</div>
2121
</div>
2222
<div class="message-system-collapsible">
2323
<ul class="message-system-list">
2424
<li repeat="foreach: rows, item: '$row'">
2525
<fastForEach args="data: getVisible(), as: '$col'" >
26-
<render args="$col.getBody()"/>
26+
<render args="$col.getBody()"></render>
2727
</fastForEach>
2828
</li>
2929
</ul>

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.3.0||~7.4.0",
8+
"php": "~7.4.0||~8.0.0",
99
"magento/framework": "*",
1010
"magento/module-catalog": "*",
1111
"magento/module-catalog-import-export": "*",

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/module-customer": "*",
1414
"magento/module-search": "*",
1515
"magento/module-store": "*",
16-
"php": "~7.3.0||~7.4.0"
16+
"php": "~7.4.0||~8.0.0"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/Amqp/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/framework-message-queue": "*",
11-
"php": "~7.3.0||~7.4.0"
11+
"php": "~7.4.0||~8.0.0"
1212
},
1313
"type": "magento2-module",
1414
"license": [

app/code/Magento/AmqpStore/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/module-store": "*",
11-
"php": "~7.3.0||~7.4.0"
11+
"php": "~7.4.0||~8.0.0"
1212
},
1313
"suggest": {
1414
"magento/module-asynchronous-operations": "*",

app/code/Magento/Analytics/Model/Config/Mapper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ public function execute($configData)
5252
$providerData['parameters'] = !empty($providerData['parameters'])
5353
? reset($providerData['parameters'])
5454
: [];
55-
$providerData['parameters'] = array_map(
56-
'reset',
57-
$providerData['parameters']
58-
);
55+
array_walk($providerData['parameters'], function (&$array) {
56+
$array = reset($array);
57+
});
5958
$providers[$providerType] = $providerData;
6059
}
6160
$files[$fileData['name']] = $fileData;

app/code/Magento/Analytics/Test/Unit/Model/Connector/Http/Client/CurlTest.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ class CurlTest extends TestCase
5050
private $converterMock;
5151

5252
/**
53-
* @return void
53+
* @inheritdoc
5454
*/
5555
protected function setUp(): void
5656
{
5757
$this->curlAdapterMock = $this->createMock(\Magento\Framework\HTTP\Adapter\Curl::class);
5858

5959
$this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class);
6060
$curlFactoryMock = $this->getMockBuilder(CurlFactory::class)
61-
->setMethods(['create'])
61+
->onlyMethods(['create'])
6262
->disableOriginalConstructor()
6363
->getMock();
6464
$curlFactoryMock
@@ -76,7 +76,7 @@ protected function setUp(): void
7676
'curlFactory' => $curlFactoryMock,
7777
'responseFactory' => $this->responseFactoryMock,
7878
'converter' => $this->converterMock,
79-
'logger' => $this->loggerMock,
79+
'logger' => $this->loggerMock
8080
]
8181
);
8282
}
@@ -94,7 +94,7 @@ public function getTestData()
9494
'version' => '1.1',
9595
'body'=> ['name' => 'value'],
9696
'url' => 'http://www.mystore.com',
97-
'method' => ZendClient::POST,
97+
'method' => ZendClient::POST
9898
]
9999
]
100100
];
@@ -122,14 +122,8 @@ public function testRequestSuccess(array $data)
122122
$this->curlAdapterMock->expects($this->once())
123123
->method('read')
124124
->willReturn($responseString);
125-
$this->curlAdapterMock
126-
->method('getErrno')
127-
->willReturn(0);
128-
129-
$this->responseFactoryMock
130-
->method('create')
131-
->with($responseString)
132-
->willReturn($response);
125+
$this->curlAdapterMock->method('getErrno')->willReturn(0);
126+
$this->responseFactoryMock->method('create')->with($responseString)->willReturn($response);
133127

134128
$this->assertEquals(
135129
$response,
@@ -196,7 +190,7 @@ public function testRequestError(array $data)
196190
private function createJsonConverter()
197191
{
198192
$converterMock = $this->getMockBuilder(JsonConverter::class)
199-
->setMethodsExcept(['getContentTypeHeader'])
193+
->onlyMethods(['getContentTypeHeader','toBody'])
200194
->disableOriginalConstructor()
201195
->getMock();
202196
$converterMock->method('toBody')->willReturnCallback(function ($value) {

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-analytics",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.3.0||~7.4.0",
5+
"php": "~7.4.0||~8.0.0",
66
"magento/module-backend": "*",
77
"magento/module-config": "*",
88
"magento/module-integration": "*",

app/code/Magento/AsynchronousOperations/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-authorization": "*",
1212
"magento/module-backend": "*",
1313
"magento/module-ui": "*",
14-
"php": "~7.3.0||~7.4.0"
14+
"php": "~7.4.0||~8.0.0"
1515
},
1616
"suggest": {
1717
"magento/module-admin-notification": "*",

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
<div class="message-system-short">
1010
<button class="message-system-action-dropdown" toggleCollapsible>
1111
<span>
12-
<translate args="'System Messages'"/>:
13-
<text args="totalRecords"/>
12+
<translate args="'System Messages'"></translate>:
13+
<text args="totalRecords"></text>
1414
</span>
1515
</button>
1616
<div class="message-system-short-wrapper" if="rows[0]" repeat="foreach: [rows[0]], item: '$row'" visible="!$collapsible.opened()">
1717
<fastForEach args="data: getVisible(), as: '$col'" >
18-
<render args="$col.getBody()"/>
18+
<render args="$col.getBody()"></render>
1919
</fastForEach>
2020
</div>
2121
</div>
2222
<div class="message-system-collapsible">
2323
<ul class="message-system-list">
2424
<li repeat="foreach: rows, item: '$row'">
2525
<fastForEach args="data: getVisible(), as: '$col'" >
26-
<render args="$col.getBody()"/>
26+
<render args="$col.getBody()"></render>
2727
</fastForEach>
2828
</li>
2929
</ul>

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.3.0||~7.4.0",
8+
"php": "~7.4.0||~8.0.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*"
1111
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public function fileClose($resource): bool
851851
//phpcs:enable
852852

853853
foreach ($this->streams as $path => $stream) {
854-
//phpcs:disable
854+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
855855
if (stream_get_meta_data($stream)['uri'] === $resourcePath) {
856856
$this->adapter->writeStream($path, $resource, new Config(self::CONFIG));
857857

app/code/Magento/AwsS3/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.3.0||~7.4.0",
8+
"php": "~7.4.0||~8.0.0",
99
"magento/framework": "*",
1010
"magento/module-remote-storage": "*",
1111
"league/flysystem": "^2.0",

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public function __construct(
102102
}
103103

104104
/**
105+
* Ensures user is authenticated before accessing backend action controllers.
106+
*
105107
* @param \Magento\Backend\App\AbstractAction $subject
106108
* @param \Closure $proceed
107109
* @param \Magento\Framework\App\RequestInterface $request
@@ -225,10 +227,9 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt
225227

226228
// Checks, whether secret key is required for admin access or request uri is explicitly set
227229
if ($this->_url->useSecretKey()) {
228-
$requestParts = explode('/', trim($request->getRequestUri(), '/'), 3);
229-
$baseUrlPath = trim(parse_url($this->backendUrl->getBaseUrl(), PHP_URL_PATH), '/');
230-
$routeIndex = empty($baseUrlPath) ? 0 : 1;
231-
$requestUri = $this->_url->getUrl($requestParts[$routeIndex]);
230+
// The requested URL has an invalid secret key and therefore redirecting to this URL
231+
// will cause a security vulnerability.
232+
$requestUri = $this->_url->getUrl($this->_url->getStartupPageUrl());
232233
} elseif ($request) {
233234
$requestUri = $request->getRequestUri();
234235
}

app/code/Magento/Backend/Model/Dashboard/Chart/Date.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function getByPeriod(string $period): array
6363

6464
if ($period === Period::PERIOD_24_HOURS) {
6565
$dateEnd->modify('-1 hour');
66+
} elseif ($period === Period::PERIOD_TODAY) {
67+
$dateEnd->modify('now');
6668
} else {
6769
$dateEnd->setTime(23, 59, 59);
6870
$dateStart->setTime(0, 0, 0);

app/code/Magento/Backend/Model/Dashboard/Period.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
class Period
1414
{
15+
public const PERIOD_TODAY = 'today';
1516
public const PERIOD_24_HOURS = '24h';
1617
public const PERIOD_7_DAYS = '7d';
1718
public const PERIOD_1_MONTH = '1m';
@@ -30,6 +31,7 @@ class Period
3031
public function getDatePeriods(): array
3132
{
3233
return [
34+
static::PERIOD_TODAY => __('Today'),
3335
static::PERIOD_24_HOURS => __('Last 24 Hours'),
3436
static::PERIOD_7_DAYS => __('Last 7 Days'),
3537
static::PERIOD_1_MONTH => __('Current Month'),
@@ -46,6 +48,7 @@ public function getDatePeriods(): array
4648
public function getPeriodChartUnits(): array
4749
{
4850
return [
51+
static::PERIOD_TODAY => self::PERIOD_UNIT_HOUR,
4952
static::PERIOD_24_HOURS => self::PERIOD_UNIT_HOUR,
5053
static::PERIOD_7_DAYS => self::PERIOD_UNIT_DAY,
5154
static::PERIOD_1_MONTH => self::PERIOD_UNIT_DAY,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AdminAssertNoErrorMessageActionGroup">
12+
<dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminClickLogoutActionGroup">
12+
<grabAttributeFrom selector="{{AdminHeaderSection.signOut}}" userInput="href" stepKey="logoutUrl"/>
13+
<amOnPage url="{$logoutUrl}" stepKey="logout2"/>
14+
</actionGroup>
15+
</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="AdminLoginWithCustomUrlActionGroup" extends="AdminLoginActionGroup">
12+
<annotations>
13+
<description>Login to specific backend URL.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customUrl" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{customUrl}}" stepKey="navigateToAdmin"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Section/AdminHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
1818
<!-- Used for page not found error -->
1919
<element name="pageNotFoundTitle" type="text" selector=".page-title span"/>
20+
<element name="signOut" type="button" selector=".page-header .account-signout"/>
2021
</section>
2122
</sections>

0 commit comments

Comments
 (0)