Skip to content

Commit

Permalink
Fix #3278. Migrate address fullName in commerce/upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuapease committed Oct 3, 2023
1 parent b2d5f6d commit c05bbb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/console/controllers/UpgradeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,9 +965,13 @@ private function _createAddress($data): Address
$address->locality = $data['city'];
$address->dependentLocality = '';

if ($data['firstName'] || $data['lastName']) {
if ($data['fullName'] || $data['firstName'] || $data['lastName']) {
$this->_ensureAddressField(new FullNameField());
$address->fullName = implode(' ', array_filter([$data['firstName'], $data['lastName']]));
if ($data['fullName']) {
$address->fullName = $data['fullName'];
} else {
$address->fullName = implode(' ', array_filter([$data['firstName'], $data['lastName']]));
}
}

if ($data['businessName']) {
Expand Down

0 comments on commit c05bbb2

Please sign in to comment.