Skip to content

Commit 57f5c19

Browse files
committed
ACP2E-3660: REST endpoint Product Import Json not validate the mandatory fields
1 parent 24e4d63 commit 57f5c19

File tree

2 files changed

+8
-3
lines changed
  • app/code/Magento/CatalogImportExport

2 files changed

+8
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function isValid($value)
3434
$this->_clearMessages();
3535
if (!$this->hasNameValue($value) &&
3636
!$this->hasCustomOptions($value) &&
37-
!$this->skuStorage->has($value[Product::COL_SKU])
37+
!$this->skuStorage->has($value[Product::COL_SKU]) &&
38+
(!isset($value['store_view_code']) || $value['store_view_code'] === '')
3839
) {
3940
$this->_addMessages(
4041
[

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ public static function getRowData(): array
5656
return [
5757
[
5858
false,
59-
['name' => null, 'store_view_code' => 'en', 'sku' => 'sku']
59+
['name' => null, 'store_view_code' => '', 'sku' => 'sku']
6060
],
6161
[
6262
true,
6363
['name' => 'anything goes here', 'store_view_code' => 'en', 'sku' => 'sku']
64-
]
64+
],
65+
[
66+
true,
67+
['name' => null, 'store_view_code' => 'en', 'sku' => 'sku']
68+
],
6569
];
6670
}
6771
}

0 commit comments

Comments
 (0)