Skip to content

Commit 235b11e

Browse files
committed
Merge remote-tracking branch 'upstream/2.4-develop' into B2B-2379-bk
2 parents 487679f + d379b7f commit 235b11e

File tree

97 files changed

+2186
-753
lines changed

Some content is hidden

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

97 files changed

+2186
-753
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/Console/Command/AbstractCacheSetCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
namespace Magento\Backend\Console\Command;
88

9+
use Magento\Framework\Console\Cli;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Output\OutputInterface;
1112

1213
/**
14+
* phpcs:disable Magento2.Classes.AbstractApi
1315
* @api
1416
* @since 100.0.2
1517
*/
@@ -23,7 +25,7 @@ abstract class AbstractCacheSetCommand extends AbstractCacheManageCommand
2325
abstract protected function isEnable();
2426

2527
/**
26-
* {@inheritdoc}
28+
* @inheritdoc
2729
*/
2830
protected function execute(InputInterface $input, OutputInterface $output)
2931
{
@@ -43,5 +45,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4345
$output->writeln('Cleaned cache types:');
4446
$output->writeln(join(PHP_EOL, $changedTypes));
4547
}
48+
49+
return Cli::RETURN_SUCCESS;
4650
}
4751
}

app/code/Magento/Backend/Console/Command/AbstractCacheTypeManageCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
namespace Magento\Backend\Console\Command;
88

9+
use Magento\Framework\Console\Cli;
910
use Magento\Framework\Event\ManagerInterface as EventManagerInterface;
1011
use Symfony\Component\Console\Input\InputInterface;
1112
use Symfony\Component\Console\Output\OutputInterface;
1213
use Magento\Framework\App\Cache\Manager;
1314

1415
/**
16+
* phpcs:disable Magento2.Classes.AbstractApi
1517
* @api
1618
* @since 100.0.2
1719
*/
@@ -54,13 +56,15 @@ abstract protected function getDisplayMessage();
5456
*
5557
* @param InputInterface $input
5658
* @param OutputInterface $output
57-
* @return void
59+
* @return int
5860
*/
5961
protected function execute(InputInterface $input, OutputInterface $output)
6062
{
6163
$types = $this->getRequestedTypes($input);
6264
$this->performAction($types);
6365
$output->writeln($this->getDisplayMessage());
6466
$output->writeln(join(PHP_EOL, $types));
67+
68+
return Cli::RETURN_SUCCESS;
6569
}
6670
}

app/code/Magento/Backend/Console/Command/CacheStatusCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Backend\Console\Command;
88

9+
use Magento\Framework\Console\Cli;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Output\OutputInterface;
1112

@@ -18,7 +19,7 @@
1819
class CacheStatusCommand extends AbstractCacheCommand
1920
{
2021
/**
21-
* {@inheritdoc}
22+
* @inheritdoc
2223
*/
2324
protected function configure()
2425
{
@@ -28,13 +29,15 @@ protected function configure()
2829
}
2930

3031
/**
31-
* {@inheritdoc}
32+
* @inheritdoc
3233
*/
3334
protected function execute(InputInterface $input, OutputInterface $output)
3435
{
3536
$output->writeln('Current status:');
3637
foreach ($this->cacheManager->getStatus() as $cache => $status) {
3738
$output->writeln(sprintf('%30s: %d', $cache, $status));
3839
}
40+
41+
return Cli::RETURN_SUCCESS;
3942
}
4043
}

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

0 commit comments

Comments
 (0)