Skip to content

Commit

Permalink
Handle quoted columns names in the boolean fields migration (see #7194)
Browse files Browse the repository at this point in the history
Description
-----------

Fixes #7182

Commits
-------

52244e3 Fix boolean fields migration column name
  • Loading branch information
ausi committed May 7, 2024
1 parent 74afbb0 commit d26e0ce
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,12 @@ private function getTargets(): array

foreach ($GLOBALS['TL_DCA'][$tableName]['fields'] ?? [] as $fieldName => $fieldConfig) {
$fieldName = strtolower($fieldName);
$field = $columns[$fieldName] ?? $columns["`$fieldName`"] ?? null;

if (!isset($columns[$fieldName]) || Types::BOOLEAN !== ($fieldConfig['sql']['type'] ?? null)) {
if (null === $field || Types::BOOLEAN !== ($fieldConfig['sql']['type'] ?? null)) {
continue;
}

$field = $columns[$fieldName];

if ($field->getType() instanceof StringType) {
$targets[] = [$tableName, $fieldName];
}
Expand Down

0 comments on commit d26e0ce

Please sign in to comment.