Skip to content

Commit 88e9708

Browse files
Merge remote-tracking branch 'magento2/2.4-develop' into ref-AdminAddBundleItemsTest
2 parents 66b3a1d + f69a8ee commit 88e9708

File tree

989 files changed

+33618
-22666
lines changed

Some content is hidden

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

989 files changed

+33618
-22666
lines changed

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.4.0||~8.0.0",
8+
"php": "~7.4.0||~8.0.0||~8.1.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.4.0||~8.0.0",
8+
"php": "~7.4.0||~8.0.0||~8.1.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdminNotification/view/adminhtml/web/system/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ define([
6969
}
7070
});
7171

72-
$(document).ready(function () {
72+
$(function () {
7373
$('#system_messages .message-system-short .error').on('click', function () {
7474
$('#message-system-all').systemMessageDialog('openModal', 1);
7575
});

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.4.0||~8.0.0",
8+
"php": "~7.4.0||~8.0.0||~8.1.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.4.0||~8.0.0"
16+
"php": "~7.4.0||~8.0.0||~8.1.0"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/AdvancedSearch/view/adminhtml/web/js/testconnection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ define([
4444
fieldToCheck = this.options.fieldToCheck || 'success';
4545

4646
element.removeClass('success').addClass('fail');
47-
$.each($.parseJSON(this.options.fieldMapping), function (key, el) {
47+
$.each(JSON.parse(this.options.fieldMapping), function (key, el) {
4848
params[key] = $('#' + el).val();
4949
});
5050
$.ajax({

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.4.0||~8.0.0"
11+
"php": "~7.4.0||~8.0.0||~8.1.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.4.0||~8.0.0"
11+
"php": "~7.4.0||~8.0.0||~8.1.0"
1212
},
1313
"suggest": {
1414
"magento/module-asynchronous-operations": "*",

app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct(
3434
*
3535
* @return array
3636
*/
37+
#[\ReturnTypeWillChange]
3738
public function current()
3839
{
3940
$current = parent::current();
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+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Analytics\Plugin;
10+
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Integration\Model\Integration;
13+
use Magento\Integration\Model\Validator\BearerTokenValidator;
14+
15+
/**
16+
* Overrides authorization config to always allow analytics token to be used as bearer
17+
*/
18+
class BearerTokenValidatorPlugin
19+
{
20+
/**
21+
* @var ScopeConfigInterface
22+
*/
23+
private ScopeConfigInterface $config;
24+
25+
/**
26+
* @param ScopeConfigInterface $config
27+
*/
28+
public function __construct(ScopeConfigInterface $config)
29+
{
30+
$this->config = $config;
31+
}
32+
33+
/***
34+
* Always allow access token for analytics to be used as bearer
35+
*
36+
* @param BearerTokenValidator $subject
37+
* @param bool $result
38+
* @param Integration $integration
39+
* @return bool
40+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
41+
*/
42+
public function afterIsIntegrationAllowedAsBearerToken(
43+
BearerTokenValidator $subject,
44+
bool $result,
45+
Integration $integration
46+
): bool {
47+
return $result || $integration->getName() === $this->config->getValue('analytics/integration_name');
48+
}
49+
}

app/code/Magento/Analytics/ReportXml/Query.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function __construct(
5353
}
5454

5555
/**
56+
* Returns query select
57+
*
5658
* @return Select
5759
*/
5860
public function getSelect()
@@ -61,6 +63,8 @@ public function getSelect()
6163
}
6264

6365
/**
66+
* Returns Connection name
67+
*
6468
* @return string
6569
*/
6670
public function getConnectionName()
@@ -69,6 +73,8 @@ public function getConnectionName()
6973
}
7074

7175
/**
76+
* Returns configuration
77+
*
7278
* @return array
7379
*/
7480
public function getConfig()
@@ -77,11 +83,9 @@ public function getConfig()
7783
}
7884

7985
/**
80-
* Specify data which should be serialized to JSON
81-
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
82-
* @return mixed data which can be serialized by <b>json_encode</b>,
83-
* which is a value of any type other than a resource.
86+
* @inheritDoc
8487
*/
88+
#[\ReturnTypeWillChange]
8589
public function jsonSerialize()
8690
{
8791
return [
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Analytics\Test\Unit\Plugin;
10+
11+
use Magento\Analytics\Plugin\BearerTokenValidatorPlugin;
12+
use Magento\Framework\App\Config\ScopeConfigInterface;
13+
use Magento\Integration\Model\Integration;
14+
use Magento\Integration\Model\Validator\BearerTokenValidator;
15+
use PHPUnit\Framework\MockObject\MockObject;
16+
use PHPUnit\Framework\TestCase;
17+
18+
class BearerTokenValidatorPluginTest extends TestCase
19+
{
20+
/**
21+
* @var BearerTokenValidatorPlugin
22+
*/
23+
private BearerTokenValidatorPlugin $plugin;
24+
25+
/**
26+
* @var BearerTokenValidator|MockObject
27+
*/
28+
private $validator;
29+
30+
public function setUp(): void
31+
{
32+
$config = $this->createMock(ScopeConfigInterface::class);
33+
$config->method('getValue')
34+
->with('analytics/integration_name')
35+
->willReturn('abc');
36+
$this->plugin = new BearerTokenValidatorPlugin($config);
37+
$this->validator = $this->createMock(BearerTokenValidator::class);
38+
}
39+
40+
public function testTrueIsPassedThrough()
41+
{
42+
$integration = $this->createMock(Integration::class);
43+
$integration->method('__call')
44+
->with('getName')
45+
->willReturn('invalid');
46+
47+
$result = $this->plugin->afterIsIntegrationAllowedAsBearerToken($this->validator, true, $integration);
48+
self::assertTrue($result);
49+
}
50+
51+
public function testFalseWhenIntegrationDoesntMatch()
52+
{
53+
$integration = $this->createMock(Integration::class);
54+
$integration->method('__call')
55+
->with('getName')
56+
->willReturn('invalid');
57+
58+
$result = $this->plugin->afterIsIntegrationAllowedAsBearerToken($this->validator, false, $integration);
59+
self::assertFalse($result);
60+
}
61+
62+
public function testTrueWhenIntegrationMatches()
63+
{
64+
$integration = $this->createMock(Integration::class);
65+
$integration->method('__call')
66+
->with('getName')
67+
->willReturn('abc');
68+
69+
$result = $this->plugin->afterIsIntegrationAllowedAsBearerToken($this->validator, true, $integration);
70+
self::assertTrue($result);
71+
}
72+
}

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.4.0||~8.0.0",
5+
"php": "~7.4.0||~8.0.0||~8.1.0",
66
"magento/module-backend": "*",
77
"magento/module-config": "*",
88
"magento/module-integration": "*",

app/code/Magento/Analytics/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,7 @@
271271
<argument name="connectionFactory" xsi:type="object">Magento\Framework\Model\ResourceModel\Type\Db\ConnectionFactory</argument>
272272
</arguments>
273273
</type>
274+
<type name="Magento\Integration\Model\Validator\BearerTokenValidator">
275+
<plugin name="allow_bearer_token" type="Magento\Analytics\Plugin\BearerTokenValidatorPlugin"/>
276+
</type>
274277
</config>

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.4.0||~8.0.0"
14+
"php": "~7.4.0||~8.0.0||~8.1.0"
1515
},
1616
"suggest": {
1717
"magento/module-admin-notification": "*",

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.4.0||~8.0.0",
8+
"php": "~7.4.0||~8.0.0||~8.1.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*"
1111
},

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3MediaGalleryDeleteFolderTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<argument name="name" value="{{AdminMediaGalleryFolder2Data.name}}"/>
9090
</actionGroup>
9191
<actionGroup ref="AdminMediaGalleryClickImageInGridActionGroup" stepKey="selectUploadedImage">
92-
<argument name="imageName" value="{{ImageUpload.file}}"/>
92+
<argument name="imageName" value="{{ImageUpload.filename}}"/>
9393
</actionGroup>
9494
<actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelected"/>
9595
<actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="savePage"/>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3MediaGalleryDeleteImageTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<argument name="name" value="{{AdminMediaGalleryFolderData.name}}"/>
8383
</actionGroup>
8484
<actionGroup ref="AdminMediaGalleryClickImageInGridActionGroup" stepKey="selectUploadedImage">
85-
<argument name="imageName" value="{{ImageUpload.file}}"/>
85+
<argument name="imageName" value="{{ImageUpload.filename}}"/>
8686
</actionGroup>
8787
<actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelected"/>
8888
<actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="savePage"/>
@@ -117,7 +117,7 @@
117117
<argument name="imageName" value="{{ImageUpload.file}}"/>
118118
</actionGroup>
119119
<actionGroup ref="AdminMediaGalleryAssertImageNotExistsInTheGridActionGroup" stepKey="assertImageDeleted">
120-
<argument name="title" value="ImageUpload.file"/>
120+
<argument name="title" value="ImageUpload.filename"/>
121121
</actionGroup>
122122

123123
<!-- Verify Images & Directories in S3 & Local File System -->

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,16 @@
161161
<comment userInput="BIC workaround" stepKey="waitForPaymentSectionLoaded"/>
162162
<comment userInput="BIC workaround" stepKey="clickPlaceOrderButton"/>
163163
<comment userInput="BIC workaround" stepKey="orderIsSuccessfullyPlaced"/>
164-
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
164+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="clickOrderLink"/>
165+
<comment userInput="BIC workaround" stepKey="grabOrderNumber"/>
166+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="orderId"/>
165167

166168
<!-- Open Create invoice -->
167169
<comment userInput="BIC workaround" stepKey="onOrdersPage"/>
168170
<comment userInput="BIC workaround" stepKey="searchOrder"/>
169171
<comment userInput="BIC workaround" stepKey="clickOrderRow"/>
170-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin">
171-
<argument name="orderId" value="{$grabOrderNumber}"/>
172+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="goToOrderInAdmin">
173+
<argument name="entityId" value="{$orderId}"/>
172174
</actionGroup>
173175
<comment userInput="BIC workaround" stepKey="createCreditMemo"/>
174176
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
<description value="Print Order from Guest on Frontend"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-38689"/>
18-
<skip>
19-
<issueId value="MQE-2834" />
20-
</skip>
2118
<group value="remote_storage_aws_s3"/>
2219
<group value="pr_exclude"/>
2320
</annotations>

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.4.0||~8.0.0",
8+
"php": "~7.4.0||~8.0.0||~8.1.0",
99
"magento/framework": "*",
1010
"magento/module-remote-storage": "*",
1111
"league/flysystem": "^2.0",

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ protected function _getValue(DataObject $row)
9797
}
9898
return '';
9999
}
100-
return $row->getData($this->getColumn()->getIndex());
100+
return $this->getColumn()->getIndex() !== null
101+
? $row->getData($this->getColumn()->getIndex())
102+
: null;
101103
}
102104

103105
/**

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ protected function _getCurrencyCode($row)
102102
if ($code = $this->getColumn()->getCurrencyCode()) {
103103
return $code;
104104
}
105-
if ($code = $row->getData($this->getColumn()->getCurrency())) {
105+
$currency = $this->getColumn()->getCurrency();
106+
107+
if ($currency !== null && $code = $row->getData($currency)) {
106108
return $code;
107109
}
108110

@@ -118,11 +120,14 @@ protected function _getCurrencyCode($row)
118120
protected function _getRate($row)
119121
{
120122
if ($rate = $this->getColumn()->getRate()) {
121-
return (float)$rate;
123+
return (float) $rate;
122124
}
123-
if ($rate = $row->getData($this->getColumn()->getRateField())) {
124-
return (float)$rate;
125+
$rateField = $this->getColumn()->getRateField();
126+
127+
if ($rateField !== null && $rate = $row->getData($rateField)) {
128+
return (float) $rate;
125129
}
130+
126131
return $this->_defaultBaseCurrency->getRate($this->_getCurrencyCode($row));
127132
}
128133

0 commit comments

Comments
 (0)