Skip to content

Commit 97e33f5

Browse files
authored
Merge pull request #8611 from magento-l3/Tier4-PR-10-30-2023
Tier4 PR Delivery 10.30.23
2 parents edd599b + 2f58bf9 commit 97e33f5

File tree

24 files changed

+576
-105
lines changed

24 files changed

+576
-105
lines changed

app/code/Magento/Bundle/Model/LinkManagement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ private function processLinkedProduct(
235235
}
236236

237237
$selectionModel = $this->bundleSelection->create();
238+
$selectionModel->load($linkedProduct->getId());
238239
$selectionModel = $this->mapProductLinkToBundleSelectionModel(
239240
$selectionModel,
240241
$linkedProduct,

app/code/Magento/Bundle/Model/Selection.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Bundle\Model;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Bundle Selection Model
1012
*
@@ -36,8 +38,6 @@
3638
class Selection extends \Magento\Framework\Model\AbstractModel
3739
{
3840
/**
39-
* Catalog data
40-
*
4141
* @var \Magento\Catalog\Helper\Data
4242
*/
4343
protected $_catalogData;
@@ -82,7 +82,9 @@ public function beforeSave()
8282
{
8383
if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) {
8484
$this->setData('tmp_selection_price_value', $this->getSelectionPriceValue());
85+
$this->setData('tmp_selection_price_type', $this->getSelectionPriceType());
8586
$this->setSelectionPriceValue($this->getOrigData('selection_price_value'));
87+
$this->setSelectionPriceType($this->getOrigData('selection_price_type'));
8688
}
8789
parent::beforeSave();
8890
}
@@ -98,6 +100,9 @@ public function afterSave()
98100
if (null !== $this->getData('tmp_selection_price_value')) {
99101
$this->setSelectionPriceValue($this->getData('tmp_selection_price_value'));
100102
}
103+
if (null !== $this->getData('tmp_selection_price_type')) {
104+
$this->setSelectionPriceType($this->getData('tmp_selection_price_type'));
105+
}
101106
$this->getResource()->saveSelectionPrice($this);
102107

103108
if (!$this->getDefaultPriceScope()) {

app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function testAddChildCouldNotSave(): void
621621
->method('create')
622622
->willReturn($bundle);
623623

624-
$selection = $this->createPartialMock(Selection::class, ['save']);
624+
$selection = $this->createPartialMock(Selection::class, ['save', 'load']);
625625
$selection->expects($this->once())->method('save')
626626
->willReturnCallback(
627627
static function () {
@@ -696,7 +696,7 @@ public function testAddChild(): void
696696
->willReturn($selections);
697697
$this->bundleFactoryMock->expects($this->once())->method('create')->willReturn($bundle);
698698

699-
$selection = $this->createPartialMock(Selection::class, ['save', 'getId']);
699+
$selection = $this->createPartialMock(Selection::class, ['save', 'getId', 'load']);
700700
$selection->expects($this->once())->method('save');
701701
$selection->expects($this->once())->method('getId')->willReturn(42);
702702
$this->bundleSelectionMock->expects($this->once())->method('create')->willReturn($selection);

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup">
1212
<annotations>
13-
<description>Goes to the home Page Recently VIewed Product and Grab the Prdouct name and Position from it.</description>
13+
<description>Goes to the home Page Recently Viewed Product and Grab the Product name and Position from it.</description>
1414
</annotations>
1515
<arguments>
1616
<argument name="productName" type="string"/>
1717
<argument name="productPosition" type="string"/>
1818
</arguments>
19+
<waitForElementVisible selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="waitForProductToShowAtPosition"/>
1920
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="grabRelatedProductPosition"/>
2021
<assertStringContainsString stepKey="assertRelatedProductName">
2122
<actualResult type="const">$grabRelatedProductPosition</actualResult>

app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $mainImageData = $mainImage ?
3939
<?= $imageWidth ? 'width="'. $escaper->escapeHtmlAttr($imageWidth) .'"' : '' ?>
4040
<?= $imageHeight ? 'height="'. $escaper->escapeHtmlAttr($imageHeight) .'"' : '' ?>
4141
/>
42+
<link itemprop="image" href="<?= /* @noEscape */ $mainImageData ?>">
4243
</div>
4344
<?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
4445
<script type="text/x-magento-init">

app/code/Magento/Catalog/view/frontend/web/js/product/provider.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,15 @@ define([
9898
return;
9999
}
100100

101+
// Filter initial ids to remove "out of scope" and "outdated" data
102+
this.ids(
103+
this.filterIds(this.ids())
104+
);
101105
this.initIdsListener();
102106
this.idsMerger(
103107
this.idsStorage.get(),
104108
this.prepareDataFromCustomerData(customerData.get(this.identifiersConfig.namespace)())
105109
);
106-
107-
if (!_.isEmpty(this.productStorage.data())) {
108-
this.dataCollectionHandler(this.productStorage.data());
109-
} else {
110-
this.productStorage.setIds(this.data.currency, this.data.store, this.ids());
111-
}
112110
},
113111

114112
/**
@@ -176,7 +174,7 @@ define([
176174

177175
if (!_.isEmpty(data)) {
178176
this.ids(
179-
this.filterIds(_.extend(this.ids(), data))
177+
this.filterIds(_.extend(utils.copy(this.ids()), data))
180178
);
181179
}
182180
},

app/code/Magento/Catalog/view/frontend/web/js/product/storage/data-storage.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ define([
149149
if (data.items && ids.length) {
150150
//we can extend only items
151151
data = data.items;
152-
this.data(_.extend(data, currentData));
152+
this.data(_.extend(currentData, data));
153153
}
154154
},
155155

@@ -271,13 +271,9 @@ define([
271271
sentDataIds = _.keys(this.request.data);
272272
currentDataIds = _.keys(ids);
273273

274-
_.each(currentDataIds, function (id) {
275-
if (_.lastIndexOf(sentDataIds, id) === -1) {
276-
return false;
277-
}
274+
return _.every(currentDataIds, function (id) {
275+
return _.lastIndexOf(sentDataIds, id) !== -1;
278276
});
279-
280-
return true;
281277
}
282278

283279
return false;

app/code/Magento/Config/Model/Config/Backend/Email/Sender.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public function beforeSave()
3030
);
3131
}
3232

33+
if (str_contains($value, ":")) {
34+
throw new \Magento\Framework\Exception\LocalizedException(
35+
__('The sender name "%1" is not valid. The colon character is not allowed.', $value)
36+
);
37+
}
38+
3339
if (strlen($value) > 255) {
3440
throw new \Magento\Framework\Exception\LocalizedException(
3541
__('Maximum sender name length is 255. Please correct your settings.')

app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/SenderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function beforeSaveDataProvider()
5151
{
5252
return [
5353
['Mr. Real Name', 'Mr. Real Name'],
54+
['No colons:', false],
5455
[str_repeat('a', 256), false],
5556
[null, false],
5657
['', false],

app/code/Magento/Config/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ System,System
3838
"Sorry, the default display currency you selected is not available in allowed currencies.","Sorry, the default display currency you selected is not available in allowed currencies."
3939
"The ""%1"" email address is incorrect. Verify the email address and try again.","The ""%1"" email address is incorrect. Verify the email address and try again."
4040
"The sender name ""%1"" is not valid. Please use only visible characters and spaces.","The sender name ""%1"" is not valid. Please use only visible characters and spaces."
41+
"The sender name ""%1"" is not valid. The colon character is not allowed.","The sender name ""%1"" is not valid. The colon character is not allowed."
4142
"Maximum sender name length is 255. Please correct your settings.","Maximum sender name length is 255. Please correct your settings."
4243
"The file you're uploading exceeds the server size limit of %1 kilobytes.","The file you're uploading exceeds the server size limit of %1 kilobytes."
4344
"The base directory to upload file is not specified.","The base directory to upload file is not specified."

0 commit comments

Comments
 (0)