Skip to content

Commit

Permalink
Fix DB custom field column name
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Nov 3, 2023
1 parent 99b7293 commit 85680ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/console/controllers/UpgradeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ private function _migrateAddressCustomFields(): void

foreach ($this->neededCustomAddressFields as $oldAttribute => $label) {
$field = $this->_customField($oldAttribute, $label, 'address');
$this->_oldAddressFieldToNewCustomFieldHandle[$oldAttribute] = $field->handle;
$this->_oldAddressFieldToNewCustomFieldHandle[$oldAttribute] = ElementHelper::fieldColumnFromField($field);
if ($this->_allowAdminChanges && !$this->_addressFieldLayout->getFieldByHandle($field->handle)) {
$layoutElements[] = new CustomField($field);
}
Expand Down Expand Up @@ -1038,10 +1038,9 @@ private function _createAddress($data): int
}

// Set fields that were created and mapped from old data

foreach ($this->_oldAddressFieldToNewCustomFieldHandle as $oldAttribute => $customFieldHandle) {
foreach ($this->_oldAddressFieldToNewCustomFieldHandle as $oldAttribute => $dbCustomFieldHandle) {
if ($data[$oldAttribute]) {
$addressContent[$customFieldHandle] = $data[$oldAttribute];
$addressContent[$dbCustomFieldHandle] = $data[$oldAttribute];
}
}

Expand Down

0 comments on commit 85680ae

Please sign in to comment.