Skip to content

Commit 0bf03f1

Browse files
committed
ACP2E-4057: The product import process encounters an error if a multi-select attribute is configured as required
1 parent 04c2901 commit 0bf03f1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private function validateRequiredAttributeValue(string $attrCode, array $rowData
210210
{
211211
if (isset($rowData[$attrCode]) && is_array($rowData[$attrCode])) {
212212
$emptyConstant = $this->context->getEmptyAttributeValueConstant();
213-
$filteredArray = array_filter($rowData[$attrCode], function($value) {
213+
$filteredArray = array_filter($rowData[$attrCode], function ($value) {
214214
return !empty(trim($value));
215215
});
216216
return !empty($filteredArray)

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ protected function setUp(): void
5656
$entityTypeModel->expects($this->any())->method('retrieveAttributeFromCache')->willReturn([]);
5757
$this->context = $this->createPartialMock(
5858
Product::class,
59-
['retrieveProductTypeByName', 'retrieveMessageTemplate', 'getBehavior', 'getMultipleValueSeparator', 'getEmptyAttributeValueConstant']
59+
[
60+
'retrieveProductTypeByName',
61+
'retrieveMessageTemplate',
62+
'getBehavior',
63+
'getMultipleValueSeparator',
64+
'getEmptyAttributeValueConstant'
65+
]
6066
);
6167
$this->context->expects($this->any())->method('retrieveProductTypeByName')->willReturn($entityTypeModel);
6268
$this->context->expects($this->any())->method('retrieveMessageTemplate')->willReturn('error message');

0 commit comments

Comments
 (0)