Skip to content

Commit d3ca3fd

Browse files
committed
Merge remote-tracking branch 'upstream/2.4-develop' into AC-2751-upgrade-symfony-to-latest-lts
2 parents 33ac06b + 80ebca4 commit d3ca3fd

File tree

52 files changed

+1269
-228
lines changed

Some content is hidden

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

52 files changed

+1269
-228
lines changed

app/code/Magento/Authorization/Test/Fixture/Role.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99

1010
use Magento\Authorization\Model\Acl\Role\Group;
1111
use Magento\Authorization\Model\ResourceModel\Role as RoleResource;
12+
use Magento\Authorization\Model\RoleFactory;
13+
use Magento\Authorization\Model\RulesFactory;
1214
use Magento\Authorization\Model\UserContextInterface;
1315
use Magento\Framework\DataObject;
14-
use Magento\SharedCatalog\Model\SharedCatalogFactory;
1516
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
1617
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
17-
use Magento\Authorization\Model\RoleFactory;
18-
use Magento\Authorization\Model\RulesFactory;
19-
use Magento\User\Model\UserFactory;
2018

2119
/**
2220
* Creating a new admin role

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function refreshAcl($user = null)
130130
}
131131
if ($user->getReloadAclFlag()) {
132132
$user->unsetData('password');
133-
$user->setReloadAclFlag('0')->save();
133+
$user->setReloadAclFlag(0)->save();
134134
}
135135
return $this;
136136
}

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,18 @@
317317
<label>Disable Email Communications</label>
318318
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
319319
</field>
320-
<field id="host" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
320+
<field id="transport" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
321+
<label>Transport</label>
322+
<source_model>Magento\Email\Model\Config\Source\SmtpTransportType</source_model>
323+
</field>
324+
<field id="host" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
321325
<label>Host</label>
322-
<comment>For Windows server only.</comment>
326+
<comment>For SMTP and Windows server only.</comment>
323327
</field>
324-
<field id="port" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
328+
<field id="port" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
325329
<label>Port (25)</label>
326330
<validate>validate-digits validate-digits-range digits-range-0-65535</validate>
327-
<comment>Please enter at least 0 and at most 65535 (For Windows server only).</comment>
331+
<comment>Please enter at least 0 and at most 65535 (For SMTP and Windows server only).</comment>
328332
</field>
329333
<field id="set_return_path" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
330334
<label>Set Return-Path</label>
@@ -338,6 +342,34 @@
338342
<field id="set_return_path">2</field>
339343
</depends>
340344
</field>
345+
<field id="username" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
346+
<label>Username</label>
347+
<comment>Username</comment>
348+
<depends>
349+
<field id="transport">smtp</field>
350+
</depends>
351+
</field>
352+
<field id="password" translate="label comment" type="password" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
353+
<label>Password</label>
354+
<comment>Username</comment>
355+
<depends>
356+
<field id="transport">smtp</field>
357+
</depends>
358+
</field>
359+
<field id="auth" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
360+
<label>Auth</label>
361+
<source_model>Magento\Email\Model\Config\Source\SmtpAuthType</source_model>
362+
<depends>
363+
<field id="transport">smtp</field>
364+
</depends>
365+
</field>
366+
<field id="ssl" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
367+
<label>SSL</label>
368+
<source_model>Magento\Email\Model\Config\Source\SmtpSslType</source_model>
369+
<depends>
370+
<field id="transport">smtp</field>
371+
</depends>
372+
</field>
341373
</group>
342374
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
343375
<label>Images Upload Configuration</label>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,23 @@
105105
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption0Product0"/>
106106
<seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption0Product0"/>
107107
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity00"/>
108-
<seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="checkQuantity00"/>
108+
<seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity00"/>
109109

110110
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption0Product1"/>
111111
<seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption0Product1"/>
112112
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity01"/>
113-
<seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="checkQuantity01"/>
113+
<seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity01"/>
114114

115115
<!--"Radio Buttons" type option-->
116116
<checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="selectOption1Product0"/>
117117
<seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="checkOption1Product0"/>
118118
<fillField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="3" stepKey="fillQuantity10"/>
119-
<seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="3" stepKey="checkQuantity10"/>
119+
<seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="03" stepKey="checkQuantity10"/>
120120

121121
<checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '2')}}" stepKey="selectOption1Product1"/>
122122
<seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '2')}}" stepKey="checkOption1Product1"/>
123123
<fillField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="3" stepKey="fillQuantity11"/>
124-
<seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="3" stepKey="checkQuantity11"/>
124+
<seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="03" stepKey="checkQuantity11"/>
125125

126126
<!--"Checkbox" type option-->
127127
<!--This option does not support user defined quantities-->

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontValidateQuantityBundleProductsTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<!--"Drop-down" type option-->
8181
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$createProduct1.name$$ +$$$createProduct1.price$$.00" stepKey="selectOption0Product0"/>
8282
<seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$createProduct1.name$$ +$$$createProduct1.price$$.00" stepKey="checkOption0Product0"/>
83+
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="-" stepKey="emptyDropdownQuantity"/>
8384
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="-1" stepKey="fillQuantity00"/>
8485
<seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="-1" stepKey="checkQuantity00"/>
8586
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCartDropDown"/>
@@ -88,6 +89,7 @@
8889
<!--"Radio Buttons" type option-->
8990
<checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="selectOption1Product0"/>
9091
<seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Option Two', '1')}}" stepKey="checkOption1Product0"/>
92+
<fillField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="-" stepKey="emptyRadioQuantity"/>
9193
<fillField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="-1" stepKey="fillQuantity10"/>
9294
<seeInField selector="{{StorefrontBundledSection.radioButtonOptionTwoQuantity('Option Two')}}" userInput="-1" stepKey="checkQuantity10"/>
9395
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddToCartRadioButton"/>

app/code/Magento/Bundle/ViewModel/ValidateQuantity.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use Magento\Framework\Serialize\Serializer\Json;
1111
use Magento\Framework\View\Element\Block\ArgumentInterface;
12-
use Magento\Catalog\Block\Product\View as ProductView;
1312

1413
/**
1514
* ViewModel for Bundle Option Block
@@ -21,27 +20,24 @@ class ValidateQuantity implements ArgumentInterface
2120
*/
2221
private $serializer;
2322

24-
/**
25-
* @var ProductView
26-
*/
27-
private $productView;
28-
2923
/**
3024
* @param Json $serializer
31-
* @param ProductView $productView
3225
*/
3326
public function __construct(
34-
Json $serializer,
35-
ProductView $productView
27+
Json $serializer
3628
) {
3729
$this->serializer = $serializer;
38-
$this->productView = $productView;
3930
}
4031

32+
/**
33+
* Returns quantity validator.
34+
*
35+
* @return string
36+
*/
4137
public function getQuantityValidators(): string
4238
{
43-
return $this->serializer->serialize(
44-
$this->productView->getQuantityValidators()
45-
);
39+
$validators['validate-item-quantity'] = [];
40+
41+
return $this->serializer->serialize($validators);
4642
}
4743
}

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,9 @@ define([
387387
function isValidQty(bundleOption) {
388388
var isValid = true,
389389
qtyElem = bundleOption.data('qtyField'),
390-
bundleOptionType = bundleOption.prop('type'),
391-
qtyValidator = qtyElem.data('validate') &&
392-
typeof qtyElem.data('validate')['validate-item-quantity'] === 'object' ?
393-
qtyElem.data('validate')['validate-item-quantity'] : null;
394-
395-
if (['radio', 'select-one'].includes(bundleOptionType) &&
396-
qtyValidator &&
397-
(qtyElem.val() < qtyValidator.minAllowed || qtyElem.val() > qtyValidator.maxAllowed)
398-
) {
390+
bundleOptionType = bundleOption.prop('type');
391+
392+
if (['radio', 'select-one'].includes(bundleOptionType) && qtyElem.val() < 0) {
399393
isValid = false;
400394
}
401395

app/code/Magento/Catalog/Model/CategoryManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function move($categoryId, $parentId, $afterId = null)
128128
$afterId = ($afterId === null || $afterId > $lastId) ? $lastId : $afterId;
129129
}
130130
$parentPath = $parentCategory->getPath() ?? '';
131-
$path = $model->getPath();
131+
$path = $model->getPath() . '/';
132132
if ($path && strpos($parentPath, $path) === 0) {
133133
throw new \Magento\Framework\Exception\LocalizedException(
134134
__('Operation do not allow to move a parent category to any of children category')

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</actionGroup>
5252
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="uncheckMiniQtyCheckBox"/>
5353
<actionGroup ref="AdminSetMinAllowedQtyForProductActionGroup" stepKey="fillMiniAllowedQty">
54-
<argument name="qty" value="1"/>
54+
<argument name="qty" value="4"/>
5555
</actionGroup>
5656
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="uncheckMaxQtyCheckBox"/>
5757
<actionGroup ref="AdminSetMaxAllowedQtyForProductActionGroup" stepKey="fillMaxAllowedQty">
@@ -107,16 +107,20 @@
107107
<!--Add Product to the cart-->
108108
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductQuantity"/>
109109
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addToCartFromStorefrontProductPage">
110+
<argument name="productQty" value="4"/>
111+
</actionGroup>
112+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addAdditionalProductToCart">
110113
<argument name="productQty" value="1"/>
111114
</actionGroup>
112115
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessSaveMessage"/>
113-
<seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/>
116+
<seeElement selector="{{StorefrontMinicartSection.quantity(6)}}" stepKey="seeAddedProductQuantityInCart"/>
114117
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
118+
<executeJS function="return {{SimpleProduct.price}} * 5" stepKey="expectedCartSubtotal"/>
115119
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="seeProductNameInMiniCart">
116120
<argument name="productName" value="{{SimpleProduct.name}}"/>
117121
<argument name="productPrice" value="{{SimpleProduct.price}}"/>
118-
<argument name="cartSubtotal" value="{{SimpleProduct.price}}" />
119-
<argument name="qty" value="1"/>
122+
<argument name="cartSubtotal" value="{$expectedCartSubtotal}" />
123+
<argument name="qty" value="5"/>
120124
</actionGroup>
121125
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeProductPriceInMiniCart"/>
122126
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCheckOutButtonInMiniCart"/>

app/code/Magento/Catalog/Test/Unit/Model/CategoryManagementTest.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public function testGetTreeForAllScope()
201201

202202
public function testMove()
203203
{
204-
$categoryId = 2;
205-
$parentId = 1;
204+
$categoryId = 4;
205+
$parentId = 40;
206206
$afterId = null;
207207
$categoryMock = $this->getMockBuilder(Category::class)
208208
->setMockClassName('categoryMock')
@@ -214,18 +214,25 @@ public function testMove()
214214
->getMock();
215215

216216
$this->categoryRepositoryMock
217-
->expects($this->exactly(2))
217+
->expects($this->exactly(6))
218218
->method('get')
219219
->willReturnMap([
220220
[$categoryId, null, $categoryMock],
221221
[$parentId, null, $parentCategoryMock],
222222
]);
223-
$parentCategoryMock->expects($this->once())->method('hasChildren')->willReturn(true);
223+
$parentCategoryMock->expects($this->exactly(3))->method('hasChildren')
224+
->willReturn(true, false, false);
224225
$parentCategoryMock->expects($this->once())->method('getChildren')->willReturn('5,6,7');
225-
$categoryMock->expects($this->once())->method('getPath');
226-
$parentCategoryMock->expects($this->once())->method('getPath');
227-
$categoryMock->expects($this->once())->method('move')->with($parentId, '7');
226+
$categoryMock->expects($this->exactly(3))->method('getPath')
227+
->willReturnOnConsecutiveCalls('2/4', '2/3/4', '2/3/4');
228+
$parentCategoryMock->expects($this->exactly(3))->method('getPath')
229+
->willReturnOnConsecutiveCalls('2/40', '2/3/40', '2/3/44/40');
230+
$categoryMock->expects($this->exactly(3))->method('move')
231+
->withConsecutive([$parentId, '7'], [$parentId, null], [$parentId, null]);
232+
228233
$this->assertTrue($this->model->move($categoryId, $parentId, $afterId));
234+
$this->assertTrue($this->model->move($categoryId, $parentId));
235+
$this->assertTrue($this->model->move($categoryId, $parentId));
229236
}
230237

231238
public function testMoveWithException()
@@ -251,8 +258,8 @@ public function testMoveWithException()
251258
[$categoryId, null, $categoryMock],
252259
[$parentId, null, $parentCategoryMock],
253260
]);
254-
$categoryMock->expects($this->once())->method('getPath')->willReturn('test');
255-
$parentCategoryMock->expects($this->once())->method('getPath')->willReturn('test');
261+
$categoryMock->expects($this->once())->method('getPath')->willReturn('test/2');
262+
$parentCategoryMock->expects($this->once())->method('getPath')->willReturn('test/2/1');
256263
$this->model->move($categoryId, $parentId, $afterId);
257264
}
258265

0 commit comments

Comments
 (0)