Skip to content

Commit 4750bc1

Browse files
committed
Merge remote-tracking branch 'l3/MC-39483' into PR-01-21
2 parents bfc1c5a + b6baab1 commit 4750bc1

File tree

2 files changed

+4
-3
lines changed
  • app/code/Magento/CustomerImportExport/Model/Import
  • dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import

2 files changed

+4
-3
lines changed

app/code/Magento/CustomerImportExport/Model/Import/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ protected function _prepareDataForUpdate(array $rowData): array
645645
$value = $rowData[$attributeAlias];
646646

647647
if (!strlen($rowData[$attributeAlias])) {
648-
if (!$newAddress) {
648+
if ($attributeParams['is_required']) {
649649
continue;
650650
}
651651

dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/AddressTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class AddressTest extends TestCase
8080
'remove' => [ // this data is not set in CSV file
8181
'19107' => [
8282
'city' => 'Philadelphia',
83-
'region' => 'Pennsylvania',
83+
'region' => null,
8484
],
8585
],
8686
'default' => [ // new default billing/shipping addresses
@@ -568,9 +568,10 @@ public function testUpdateFirstAndLastName()
568568
$this->assertEquals($address->getStreet(), $updatedAddress->getStreet());
569569
$this->assertEquals($address->getCity(), $updatedAddress->getCity());
570570
$this->assertEquals($address->getCountryId(), $updatedAddress->getCountryId());
571-
$this->assertEquals($address->getPostcode(), $updatedAddress->getPostcode());
572571
$this->assertEquals($address->getTelephone(), $updatedAddress->getTelephone());
573572
$this->assertEquals($address->getRegionId(), $updatedAddress->getRegionId());
573+
//assert empty non-required values changed
574+
$this->assertEquals(null, $updatedAddress->getPostcode());
574575
}
575576

576577
/**

0 commit comments

Comments
 (0)