Skip to content

Commit d2510ea

Browse files
committed
MAGETWO-59473: Default address checkbox is unchecked on Customer re-save
1 parent c0f4002 commit d2510ea

File tree

2 files changed

+3
-1
lines changed
  • app/code/Magento/Customer/Controller/Adminhtml/Index
  • dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml

2 files changed

+3
-1
lines changed

app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function _extractData(
8484
$result = $metadataForm->compactData($formData);
8585

8686
// Re-initialize additional attributes
87-
$formData = array_replace($formData, $result);
87+
$formData = array_replace($result, $formData);
8888

8989
// Unset unused attributes
9090
$formAttributes = $metadataForm->getAttributes();

dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ public function testSaveActionExistingCustomerAndExistingAddressData()
313313
$this->assertEquals(2, count($addresses));
314314
$updatedAddress = $this->addressRepository->getById(1);
315315
$this->assertEquals('update firstname', $updatedAddress->getFirstname());
316+
$this->assertTrue($updatedAddress->isDefaultBilling());
317+
$this->assertEquals($updatedAddress->getId(), $customer->getDefaultBilling());
316318
$newAddress = $this->accountManagement->getDefaultShippingAddress($customerId);
317319
$this->assertEquals('new firstname', $newAddress->getFirstname());
318320

0 commit comments

Comments
 (0)