Skip to content

Commit 2fd391d

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento/magento2ce into MC-42243
2 parents d968ea6 + ed2ffad commit 2fd391d

File tree

384 files changed

+7751
-3257
lines changed

Some content is hidden

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

384 files changed

+7751
-3257
lines changed

app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ define([
3636
return record[this.messageIndex];
3737
},
3838

39+
/**
40+
* Proxy to getLabel function with UnsanitizedHtml suffix
41+
*
42+
* @param {Object} record
43+
* @returns {String}
44+
*/
45+
getLabelUnsanitizedHtml: function (record) {
46+
return this.getLabel(record);
47+
},
48+
3949
/** @inheritdoc */
4050
getFieldClass: function ($row) {
4151
var status = this.statusMap[$row.status] || 'warning',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*/
66
-->
77
<div css="$col.getFieldClass($row())"
8-
html="$col.getLabel($row())"/>
8+
html="$col.getLabelUnsanitizedHtml($row())"></div>

app/code/Magento/AsynchronousOperations/Model/AccessValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public function isAllowed($bulkUuid)
5555
$this->bulkSummaryFactory->create(),
5656
$bulkUuid
5757
);
58-
return $bulkSummary->getUserId() === $this->userContext->getUserId();
58+
return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId());
5959
}
6060
}

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
-->
77
<div css="$data.additionalClasses"
88
if="error"
9-
text="error"/>
9+
text="error"></div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
attr="{
1212
title: $action().label
1313
}"
14-
/>
14+
></button>
1515
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
<a class="action__message-log"
3232
href="#"
3333
click="dismissAll"
34-
text="dismissAllText"/>
34+
text="dismissAllText"></a>
3535
<a class="action__message-log"
3636
attr="{
3737
href: link
3838
}"
39-
text="linkText"/>
39+
text="linkText"></a>
4040
</div>
4141
</div>
4242
</div>

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function add(UserContextInterface $userContext)
6060
*/
6161
public function getUserId()
6262
{
63-
return $this->getUserContext() ? $this->getUserContext()->getUserId() : null;
63+
return $this->getUserContext() ? ((int) $this->getUserContext()->getUserId()) : null;
6464
}
6565

6666
/**

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class="action-secondary"
1717
type="button"
1818
click="processingAddChild.bind($data, false, false, false)">
19-
<span translate="addButtonLabel"/>
19+
<span translate="addButtonLabel"></span>
2020
</button>
2121
</div>
2222

@@ -30,7 +30,7 @@
3030
css="$data.setClasses($data)"
3131
attr="'data-index': index">
3232
<label if="$data.label" class="admin__field-label" attr="for: $data.uid">
33-
<span translate="$data.label"/>
33+
<span translate="$data.label"></span>
3434
</label>
3535

3636
<div class="admin__field-control" data-role="grid-wrapper">
@@ -47,14 +47,14 @@
4747
<thead if="element.columnsHeader">
4848
<tr>
4949
<th if="$data.dndConfig.enabled"
50-
class="data-grid-draggable-row-cell"/>
50+
class="data-grid-draggable-row-cell"></th>
5151

5252
<th repeat="foreach: labels, item: '$label'"
5353
class="data-grid-th"
5454
visible="$label().visible"
5555
disable="$label().disabled"
5656
css="setClasses($label())">
57-
<span translate="$label().label"/>
57+
<span translate="$label().label"></span>
5858
</th>
5959
</tr>
6060
</thead>
@@ -65,15 +65,15 @@
6565
css="'_odd-row': $index % 2">
6666
<td if="dndConfig.enabled"
6767
class="data-grid-draggable-row-cell"
68-
template="name: dndConfig.template, data: dnd"/>
68+
template="name: dndConfig.template, data: dnd"></td>
6969

7070
<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
7171
<td if="elem.template"
7272
visible="elem.visible() && elem.formElement !== 'hidden'"
7373
disable="elem.disabled"
7474
css="$parent.setClasses(elem)"
7575
template="elem.template"
76-
attr="'data-index': index"/>
76+
attr="'data-index': index"></td>
7777
<!-- /ko -->
7878
</tr>
7979
</tbody>

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,11 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
665665
$skipSaleableCheck = $this->_catalogProduct->getSkipSaleableCheck();
666666
$_appendAllSelections = (bool)$product->getSkipCheckRequiredOption() || $skipSaleableCheck;
667667

668-
$options = $buyRequest->getBundleOption();
668+
if ($buyRequest->getBundleOptionsData()) {
669+
$options = $this->getPreparedOptions($buyRequest->getBundleOptionsData());
670+
} else {
671+
$options = $buyRequest->getBundleOption();
672+
}
669673
if (is_array($options)) {
670674
$options = $this->recursiveIntval($options);
671675
$optionIds = array_keys($options);
@@ -732,7 +736,11 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
732736
if ((is_array($selections) && count($selections) > 0) || !$isStrictProcessMode) {
733737
$uniqueKey = [$product->getId()];
734738
$selectionIds = [];
735-
$qtys = $buyRequest->getBundleOptionQty();
739+
if ($buyRequest->getBundleOptionsData()) {
740+
$qtys = $buyRequest->getBundleOptionsData();
741+
} else {
742+
$qtys = $buyRequest->getBundleOptionQty();
743+
}
736744

737745
// Shuffle selection array by option position
738746
usort($selections, [$this, 'shakeSelections']);
@@ -1231,7 +1239,12 @@ public function getIdentities(\Magento\Catalog\Model\Product $product)
12311239
protected function getQty($selection, $qtys, $selectionOptionId)
12321240
{
12331241
if ($selection->getSelectionCanChangeQty() && isset($qtys[$selectionOptionId])) {
1234-
$qty = (float)$qtys[$selectionOptionId] > 0 ? $qtys[$selectionOptionId] : 1;
1242+
if (is_array($qtys[$selectionOptionId]) && isset($qtys[$selectionOptionId][$selection->getSelectionId()])) {
1243+
$selectionQty = $qtys[$selectionOptionId][$selection->getSelectionId()];
1244+
$qty = (float)$selectionQty > 0 ? $selectionQty : 1;
1245+
} else {
1246+
$qty = (float)$qtys[$selectionOptionId] > 0 ? $qtys[$selectionOptionId] : 1;
1247+
}
12351248
} else {
12361249
$qty = (float)$selection->getSelectionQty() ? $selection->getSelectionQty() : 1;
12371250
}
@@ -1404,4 +1417,21 @@ protected function mergeSelectionsWithOptions($options, $selections)
14041417

14051418
return array_merge([], ...$selections);
14061419
}
1420+
1421+
/**
1422+
* Get prepared options with selection ids
1423+
*
1424+
* @param array $options
1425+
* @return array
1426+
*/
1427+
private function getPreparedOptions(array $options): array
1428+
{
1429+
foreach ($options as $optionId => $option) {
1430+
foreach ($option as $selectionId => $optionQty) {
1431+
$options[$optionId][$selectionId] = $selectionId;
1432+
}
1433+
}
1434+
1435+
return $options;
1436+
}
14071437
}

app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,16 @@ public function testPrepareForCartAdvancedWithoutOptions()
232232
/** @var MockObject|DataObject $buyRequest */
233233
$buyRequest = $this->getMockBuilder(DataObject::class)
234234
->setMethods(
235-
['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption']
235+
[
236+
'__wakeup',
237+
'getOptions',
238+
'getSuperProductConfig',
239+
'unsetData',
240+
'getData',
241+
'getQty',
242+
'getBundleOption',
243+
'getBundleOptionsData',
244+
]
236245
)
237246
->disableOriginalConstructor()
238247
->getMock();
@@ -342,7 +351,8 @@ public function testPrepareForCartAdvancedWithShoppingCart()
342351
'getData',
343352
'getQty',
344353
'getBundleOption',
345-
'getBundleOptionQty'
354+
'getBundleOptionQty',
355+
'getBundleOptionsData',
346356
]
347357
)
348358
->disableOriginalConstructor()
@@ -586,7 +596,8 @@ public function testPrepareForCartAdvancedEmptyShoppingCart()
586596
'getData',
587597
'getQty',
588598
'getBundleOption',
589-
'getBundleOptionQty'
599+
'getBundleOptionQty',
600+
'getBundleOptionsData',
590601
]
591602
)
592603
->disableOriginalConstructor()
@@ -811,7 +822,8 @@ public function testPrepareForCartAdvancedStringInResult()
811822
'getData',
812823
'getQty',
813824
'getBundleOption',
814-
'getBundleOptionQty'
825+
'getBundleOptionQty',
826+
'getBundleOptionsData',
815827
]
816828
)
817829
->disableOriginalConstructor()
@@ -1030,7 +1042,8 @@ public function testPrepareForCartAdvancedWithoutSelections()
10301042
'getData',
10311043
'getQty',
10321044
'getBundleOption',
1033-
'getBundleOptionQty'
1045+
'getBundleOptionQty',
1046+
'getBundleOptionsData',
10341047
]
10351048
)
10361049
->disableOriginalConstructor()
@@ -1131,7 +1144,16 @@ public function testPrepareForCartAdvancedSelectionsSelectionIdsExists()
11311144
/** @var MockObject|DataObject $buyRequest */
11321145
$buyRequest = $this->getMockBuilder(DataObject::class)
11331146
->setMethods(
1134-
['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption']
1147+
[
1148+
'__wakeup',
1149+
'getOptions',
1150+
'getSuperProductConfig',
1151+
'unsetData',
1152+
'getData',
1153+
'getQty',
1154+
'getBundleOption',
1155+
'getBundleOptionsData',
1156+
]
11351157
)
11361158
->disableOriginalConstructor()
11371159
->getMock();
@@ -1258,7 +1280,16 @@ public function testPrepareForCartAdvancedSelectRequiredOptions()
12581280
/** @var MockObject|DataObject $buyRequest */
12591281
$buyRequest = $this->getMockBuilder(DataObject::class)
12601282
->setMethods(
1261-
['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption']
1283+
[
1284+
'__wakeup',
1285+
'getOptions',
1286+
'getSuperProductConfig',
1287+
'unsetData',
1288+
'getData',
1289+
'getQty',
1290+
'getBundleOption',
1291+
'getBundleOptionsData',
1292+
]
12621293
)
12631294
->disableOriginalConstructor()
12641295
->getMock();
@@ -1422,7 +1453,16 @@ public function testPrepareForCartAdvancedAllRequiredOption()
14221453
/** @var MockObject|DataObject $buyRequest */
14231454
$buyRequest = $this->getMockBuilder(DataObject::class)
14241455
->setMethods(
1425-
['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption']
1456+
[
1457+
'__wakeup',
1458+
'getOptions',
1459+
'getSuperProductConfig',
1460+
'unsetData',
1461+
'getData',
1462+
'getQty',
1463+
'getBundleOption',
1464+
'getBundleOptionsData',
1465+
]
14261466
)
14271467
->disableOriginalConstructor()
14281468
->getMock();
@@ -1523,7 +1563,16 @@ public function testPrepareForCartAdvancedSpecifyProductOptions()
15231563
/** @var MockObject|DataObject $buyRequest */
15241564
$buyRequest = $this->getMockBuilder(DataObject::class)
15251565
->setMethods(
1526-
['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption']
1566+
[
1567+
'__wakeup',
1568+
'getOptions',
1569+
'getSuperProductConfig',
1570+
'unsetData',
1571+
'getData',
1572+
'getQty',
1573+
'getBundleOption',
1574+
'getBundleOptionsData',
1575+
]
15271576
)
15281577
->disableOriginalConstructor()
15291578
->getMock();

0 commit comments

Comments
 (0)