Skip to content

Commit fe4ece7

Browse files
committed
Merge branch '2.4-develop' into 2.4.4-beta-sync
2 parents cc5f15c + ac88ad9 commit fe4ece7

File tree

528 files changed

+5631
-4366
lines changed

Some content is hidden

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

528 files changed

+5631
-4366
lines changed

Gruntfile.js.sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ module.exports = function (grunt) {
5252
prod: function (component) {
5353
var tasks = [
5454
'less',
55-
'autoprefixer',
5655
'cssmin',
5756
'usebanner'
5857
].map(function (task) {

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/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/Model/ResourceModel/Index.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ public function __construct(
8080

8181
/**
8282
* Implementation of abstract construct
83+
*
8384
* @return void
8485
* @since 100.1.0
86+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
8587
*/
8688
protected function _construct()
8789
{
@@ -118,7 +120,8 @@ protected function _getCatalogProductPriceData($productIds = null)
118120

119121
$result = [];
120122
foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {
121-
$result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);
123+
$result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] =
124+
round((float) $row['min_price'], 2);
122125
}
123126

124127
return $result;

app/code/Magento/AdvancedSearch/Test/Unit/Model/ResourceModel/IndexTest.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class IndexTest extends TestCase
6060
*/
6161
private $resourceConnectionMock;
6262

63+
/**
64+
* @inheritdoc
65+
*/
6366
protected function setUp(): void
6467
{
6568
$this->storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class);
@@ -98,6 +101,9 @@ protected function setUp(): void
98101
);
99102
}
100103

104+
/**
105+
* @return void
106+
*/
101107
public function testGetPriceIndexDataUsesFrontendPriceIndexerTable(): void
102108
{
103109
$storeId = 1;
@@ -117,4 +123,73 @@ public function testGetPriceIndexDataUsesFrontendPriceIndexerTable(): void
117123

118124
$this->assertEmpty($this->model->getPriceIndexData([1], $storeId));
119125
}
126+
127+
/**
128+
* @param array $testData
129+
* @dataProvider providerForTestPriceIndexData
130+
*
131+
* @return void
132+
*/
133+
public function testGetPriceIndexData(array $testData): void
134+
{
135+
$storeMock = $this->getMockForAbstractClass(StoreInterface::class);
136+
$storeMock->expects($this->any())->method('getId')->willReturn(1);
137+
$storeMock->method('getWebsiteId')->willReturn($testData['website_id']);
138+
$this->storeManagerMock->expects($this->once())
139+
->method('getStore')
140+
->with(1)->willReturn($storeMock);
141+
142+
$selectMock = $this->createMock(Select::class);
143+
$selectMock->expects($this->any())->method('union')->willReturnSelf();
144+
$this->adapterMock->expects($this->any())->method('select')->willReturn($selectMock);
145+
$this->adapterMock->expects($this->any())->method('fetchAll')->with($selectMock)->willReturn([$testData]);
146+
$expectedData = [
147+
$testData['entity_id'] => [
148+
$testData['customer_group_id'] => round((float) $testData['min_price'], 2)
149+
]
150+
];
151+
152+
$this->assertEquals($this->model->getPriceIndexData([1], 1), $expectedData);
153+
}
154+
155+
/**
156+
* @return array
157+
*/
158+
public function providerForTestPriceIndexData(): array
159+
{
160+
return [
161+
[
162+
[
163+
'website_id' => 1,
164+
'entity_id' => 1,
165+
'customer_group_id' => 1,
166+
'min_price' => '12.12'
167+
]
168+
],
169+
[
170+
[
171+
'website_id' => 1,
172+
'entity_id' => 2,
173+
'customer_group_id' => 2,
174+
'min_price' => null
175+
]
176+
],
177+
[
178+
[
179+
'website_id' => 1,
180+
'entity_id' => 3,
181+
'customer_group_id' => 3,
182+
'min_price' => 12.12
183+
]
184+
],
185+
[
186+
[
187+
'website_id' => 1,
188+
'entity_id' => 3,
189+
'customer_group_id' => 3,
190+
'min_price' => ''
191+
]
192+
]
193+
];
194+
}
120195
}

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/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/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/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/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-backup": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/Backend/view/adminhtml/templates/widget/form/container.phtml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@
3232
3333
require([
3434
'jquery',
35-
'mage/backend/form',
36-
'mage/backend/validation'
35+
'mage/mage'
3736
], function($){
3837
39-
$('#edit_form').form()
40-
.validation({
38+
$('#edit_form').mage('form').mage('validation', {
4139
validationUrl: '{$block->escapeJs($block->getValidationUrl())}',
4240
highlight: function(element) {
4341
var detailsElement = $(element).closest('details');
@@ -49,8 +47,7 @@ require([
4947
}
5048
$(element).trigger('highlight.validate');
5149
}
52-
});
53-
50+
});
5451
});
5552
5653
script;

app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-94176"/>
1919
<group value="backup"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Magento backup functionality is deprecated</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<magentoCLI command="config:set {{EnableBackupFunctionality.path}} {{EnableBackupFunctionality.value}}" stepKey="setEnableBackup"/>

app/code/Magento/Backup/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-cron": "*",

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
class Renderer extends \Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer
2020
{
2121
/**
22-
* Serializer
23-
*
2422
* @var Json
2523
*/
2624
private $serializer;
@@ -211,7 +209,7 @@ public function getValueHtml($item)
211209
if (!$this->isChildCalculated($item)) {
212210
$attributes = $this->getSelectionAttributes($item);
213211
if ($attributes) {
214-
$result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']);
212+
$result .= " " . $this->getItem()->getOrder()->formatBasePrice($attributes['price']);
215213
}
216214
}
217215
return $result;

app/code/Magento/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
class Renderer extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer
1717
{
1818
/**
19-
* Serializer
20-
*
2119
* @var Json
2220
*/
2321
private $serializer;
@@ -43,7 +41,10 @@ public function __construct(
4341
}
4442

4543
/**
44+
* Check if shipment type (invoice etc) is separate
45+
*
4646
* @param mixed $item
47+
*
4748
* @return bool
4849
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
4950
*/
@@ -79,7 +80,10 @@ public function isShipmentSeparately($item = null)
7980
}
8081

8182
/**
83+
* Check if sub product calculations are present
84+
*
8285
* @param mixed $item
86+
*
8387
* @return bool
8488
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8589
*/
@@ -117,7 +121,10 @@ public function isChildCalculated($item = null)
117121
}
118122

119123
/**
124+
* Get bundle selection attributes
125+
*
120126
* @param mixed $item
127+
*
121128
* @return mixed|null
122129
*/
123130
public function getSelectionAttributes($item)
@@ -134,14 +141,17 @@ public function getSelectionAttributes($item)
134141
}
135142

136143
/**
144+
* Get html of bundle selection attributes
145+
*
137146
* @param mixed $item
147+
*
138148
* @return string
139149
*/
140150
public function getValueHtml($item)
141151
{
142152
if ($attributes = $this->getSelectionAttributes($item)) {
143153
return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " "
144-
. $this->getOrder()->formatPrice($attributes['price']);
154+
. $this->getOrder()->formatBasePrice($attributes['price']);
145155
}
146156
return $this->escapeHtml($item->getName());
147157
}
@@ -183,7 +193,10 @@ public function getChildren($item)
183193
}
184194

185195
/**
196+
* Check if price info can be shown
197+
*
186198
* @param mixed $item
199+
*
187200
* @return bool
188201
*/
189202
public function canShowPriceInfo($item)

0 commit comments

Comments
 (0)