Skip to content

Commit 54d065a

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #17056: [Forwardport] Add generated code to the psr-0 autoloader section so when optimizing� (by @torhoehn) - #17049: [Forwardport] Log when Magento is in maintenance mode (by @torhoehn) - #17044: [Forwardport] Update nginx.config.sample to exclude php5-fpm (by @torhoehn) - #17054: [Forwardport] Remove extra spaces from Magento/Ui (by @torhoehn) - #17060: [Forwardport] fix: add hasrequired notice for create account form and password forg� (by @DanielRuf) - #17042: [Forwardport] Remove direct use of object manager (by @torhoehn) - #16956: [Forwardport] Trim issue on customer confirmation form (by @gelanivishal) - magento-engcom/import-export-improvements#117: magento-engcom/import-export-improvements#103 Fail product import validation when multiselect columns contain duplicate values (by @pogster) - #17043: [Forwardport] Add Clean Code (by @torhoehn) - #17046: [Forwardport] Remove duplicated string. (by @torhoehn) Fixed GitHub Issues: - #6058: IE11 user login email validation fails if field has leading or trailing space (reported by @dnadle) has been fixed in #16956 by @gelanivishal in 2.3-develop branch Related commits: 1. f3502da 2. 9d15ecc 3. 6897f27 - #103: Phoenix/Moneybookers (reported by @riconeitzel) has been fixed in magento-engcom/import-export-improvements#117 by @pogster in 2.3-develop branch Related commits: 1. a765ec7 2. d45e4f8
2 parents a02fa7c + cba0ec0 commit 54d065a

File tree

21 files changed

+130
-33
lines changed

21 files changed

+130
-33
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
294294
ValidatorInterface::ERROR_MEDIA_PATH_NOT_ACCESSIBLE => 'Imported resource (image) does not exist in the local media storage',
295295
ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE => 'Imported resource (image) could not be downloaded from external resource due to timeout or access permissions',
296296
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
297-
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually'
297+
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually',
298+
ValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES => "Value for multiselect attribute %s contains duplicated values",
298299
];
299300
//@codingStandardsIgnoreEnd
300301

app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn
8585

8686
const ERROR_DUPLICATE_URL_KEY = 'duplicatedUrlKey';
8787

88+
const ERROR_DUPLICATE_MULTISELECT_VALUES = 'duplicatedMultiselectValues';
89+
8890
/**
8991
* Value that means all entities (e.g. websites, groups etc.)
9092
*/

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData)
219219
break;
220220
}
221221
}
222+
223+
$uniqueValues = array_unique($values);
224+
if (count($uniqueValues) != count($values)) {
225+
$valid = false;
226+
$this->_addMessages([RowValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES]);
227+
}
222228
break;
223229
case 'datetime':
224230
$val = trim($rowData[$attrCode]);

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/ValidatorTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,26 @@ public function attributeValidationProvider()
167167
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 2'],
168168
true
169169
],
170+
[
171+
Import::BEHAVIOR_APPEND,
172+
['is_required' => true, 'type' => 'multiselect',
173+
'options' => ['option 1' => 0, 'option 2' => 1, 'option 3']],
174+
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 2|Option 1'],
175+
false
176+
],
177+
[
178+
Import::BEHAVIOR_APPEND,
179+
['is_required' => true, 'type' => 'multiselect',
180+
'options' => ['option 1' => 0, 'option 2' => 1, 'option 3']],
181+
['product_type' => 'any', 'attribute_code' => 'Option 3|Option 3|Option 3|Option 1'],
182+
false
183+
],
184+
[
185+
Import::BEHAVIOR_APPEND,
186+
['is_required' => true, 'type' => 'multiselect', 'options' => ['option 1' => 0]],
187+
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 1|Option 1|Option 1'],
188+
false
189+
],
170190
[
171191
Import::BEHAVIOR_APPEND,
172192
['is_required' => true, 'type' => 'datetime'],

app/code/Magento/CatalogRule/Model/Rule/Job.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
* See COPYING.txt for license details.
99
*/
1010

11+
namespace Magento\CatalogRule\Model\Rule;
12+
13+
use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor;
14+
1115
/**
1216
* Catalog Rule job model
1317
*
@@ -18,13 +22,8 @@
1822
* @method bool hasSuccess()
1923
* @method bool hasError()
2024
*
21-
* @author Magento Core Team <core@magentocommerce.com>
22-
*/
23-
namespace Magento\CatalogRule\Model\Rule;
24-
25-
use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor;
26-
27-
/**
25+
* @author Magento Core Team <core@magentocommerce.com>
26+
*
2827
* @api
2928
* @since 100.0.2
3029
*/
@@ -39,10 +38,14 @@ class Job extends \Magento\Framework\DataObject
3938
* Basic object initialization
4039
*
4140
* @param RuleProductProcessor $ruleProcessor
41+
* @param array $data
4242
*/
43-
public function __construct(RuleProductProcessor $ruleProcessor)
44-
{
43+
public function __construct(
44+
RuleProductProcessor $ruleProcessor,
45+
array $data = []
46+
) {
4547
$this->ruleProcessor = $ruleProcessor;
48+
parent::__construct($data);
4649
}
4750

4851
/**

app/code/Magento/Customer/view/frontend/templates/form/confirmation.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="field email required">
1515
<label for="email_address" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
1616
<div class="control">
17-
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}">
17+
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}" data-mage-init='{"mage/trim-input":{}}'>
1818
</div>
1919
</div>
2020
</fieldset>

app/code/Magento/GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Catalog\Api\Data\ProductLinkExtensionFactory;
99
use Magento\Catalog\Api\Data\ProductLinkInterfaceFactory;
1010
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Framework\Exception\NoSuchEntityException;
1112
use Magento\GroupedProduct\Model\Product\Type\Grouped as TypeGrouped;
1213

1314
/**
@@ -60,6 +61,9 @@ public function __construct(
6061
* @param array $links
6162
*
6263
* @return \Magento\Catalog\Model\Product
64+
*
65+
* @throws NoSuchEntityException
66+
*
6367
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6468
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
6569
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -70,7 +74,7 @@ public function beforeInitializeLinks(
7074
array $links
7175
) {
7276
if ($product->getTypeId() === TypeGrouped::TYPE_CODE && !$product->getGroupedReadonly()) {
73-
$links = (isset($links[self::TYPE_NAME])) ? $links[self::TYPE_NAME] : $product->getGroupedLinkData();
77+
$links = $links[self::TYPE_NAME] ?? $product->getGroupedLinkData();
7478
if (!is_array($links)) {
7579
$links = [];
7680
}

app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber/MassDelete.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,32 @@
66
*/
77
namespace Magento\Newsletter\Controller\Adminhtml\Subscriber;
88

9-
class MassDelete extends \Magento\Newsletter\Controller\Adminhtml\Subscriber
9+
use Magento\Newsletter\Controller\Adminhtml\Subscriber;
10+
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\App\Response\Http\FileFactory;
12+
use Magento\Newsletter\Model\SubscriberFactory;
13+
use Magento\Framework\App\ObjectManager;
14+
15+
class MassDelete extends Subscriber
1016
{
17+
/**
18+
* @var SubscriberFactory
19+
*/
20+
private $subscriberFactory;
21+
22+
/**
23+
* @param Context $context
24+
* @param FileFactory $fileFactory
25+
*/
26+
public function __construct(
27+
Context $context,
28+
FileFactory $fileFactory,
29+
SubscriberFactory $subscriberFactory = null
30+
) {
31+
$this->subscriberFactory = $subscriberFactory ?: ObjectManager::getInstance()->get(SubscriberFactory::class);
32+
parent::__construct($context, $fileFactory);
33+
}
34+
1135
/**
1236
* Delete one or more subscribers action
1337
*
@@ -21,9 +45,7 @@ public function execute()
2145
} else {
2246
try {
2347
foreach ($subscribersIds as $subscriberId) {
24-
$subscriber = $this->_objectManager->create(
25-
\Magento\Newsletter\Model\Subscriber::class
26-
)->load(
48+
$subscriber = $this->subscriberFactory->create()->load(
2749
$subscriberId
2850
);
2951
$subscriber->delete();

app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber/MassUnsubscribe.php

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,33 @@
66
*/
77
namespace Magento\Newsletter\Controller\Adminhtml\Subscriber;
88

9-
class MassUnsubscribe extends \Magento\Newsletter\Controller\Adminhtml\Subscriber
9+
use Magento\Newsletter\Controller\Adminhtml\Subscriber;
10+
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\App\Response\Http\FileFactory;
12+
use Magento\Newsletter\Model\SubscriberFactory;
13+
use Magento\Framework\App\ObjectManager;
14+
15+
class MassUnsubscribe extends Subscriber
1016
{
17+
/**
18+
* @var SubscriberFactory
19+
*/
20+
private $subscriberFactory;
21+
22+
/**
23+
* @param Context $context
24+
* @param FileFactory $fileFactory
25+
* @param SubscriberFactory $subscriberFactory
26+
*/
27+
public function __construct(
28+
Context $context,
29+
FileFactory $fileFactory,
30+
SubscriberFactory $subscriberFactory = null
31+
) {
32+
$this->subscriberFactory = $subscriberFactory ?: ObjectManager::getInstance()->get(SubscriberFactory::class);
33+
parent::__construct($context, $fileFactory);
34+
}
35+
1136
/**
1237
* Unsubscribe one or more subscribers action
1338
*
@@ -21,9 +46,7 @@ public function execute()
2146
} else {
2247
try {
2348
foreach ($subscribersIds as $subscriberId) {
24-
$subscriber = $this->_objectManager->create(
25-
\Magento\Newsletter\Model\Subscriber::class
26-
)->load(
49+
$subscriber = $this->subscriberFactory->create()->load(
2750
$subscriberId
2851
);
2952
$subscriber->unsubscribe();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ Delete,Delete
4040
"Autostart base video","Autostart base video"
4141
"Show related video","Show related video"
4242
"Auto restart video","Auto restart video"
43-
"Images And Videos","Images And Videos"

0 commit comments

Comments
 (0)