File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
app/code/Magento/CustomerImportExport/Model/Import Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -593,12 +593,18 @@ protected function _validateRowForUpdate(array $rowData, $rowNumber)
593
593
if (in_array ($ attributeCode , $ this ->_ignoredAttributes )) {
594
594
continue ;
595
595
}
596
- if ($ attributeParams ['is_required ' ]
597
- && ((!isset ($ rowData [$ attributeCode ]) && !$ this ->_getCustomerId ($ email , $ website ))
598
- || (isset ($ rowData [$ attributeCode ]) && '' === trim ($ rowData [$ attributeCode ])))) {
596
+
597
+ $ isFieldRequired = $ attributeParams ['is_required ' ];
598
+ $ isFieldNotSetAndCustomerDoesNotExist =
599
+ !isset ($ rowData [$ attributeCode ]) && !$ this ->_getCustomerId ($ email , $ website );
600
+ $ isFieldSetAndTrimmedValueIsEmpty
601
+ = isset ($ rowData [$ attributeCode ]) && '' === trim ($ rowData [$ attributeCode ]);
602
+
603
+ if ($ isFieldRequired && ($ isFieldNotSetAndCustomerDoesNotExist || $ isFieldSetAndTrimmedValueIsEmpty )) {
599
604
$ this ->addRowError (self ::ERROR_VALUE_IS_REQUIRED , $ rowNumber , $ attributeCode );
600
605
continue ;
601
606
}
607
+
602
608
if (isset ($ rowData [$ attributeCode ]) && strlen ($ rowData [$ attributeCode ])) {
603
609
$ this ->isAttributeValid (
604
610
$ attributeCode ,
You can’t perform that action at this time.
0 commit comments