This repository was archived by the owner on Apr 29, 2019. It is now read-only.
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)
593593 if (in_array ($ attributeCode , $ this ->_ignoredAttributes )) {
594594 continue ;
595595 }
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 )) {
599604 $ this ->addRowError (self ::ERROR_VALUE_IS_REQUIRED , $ rowNumber , $ attributeCode );
600605 continue ;
601606 }
607+
602608 if (isset ($ rowData [$ attributeCode ]) && strlen ($ rowData [$ attributeCode ])) {
603609 $ this ->isAttributeValid (
604610 $ attributeCode ,
You can’t perform that action at this time.
0 commit comments