Commit 6449b06b authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[TASK] Add strict comparison and extend tests for TcaMigaration

Resolves: #94442
Relates: #94441
Releases: master
Change-Id: Iaebd23d0031917c5c5c121c4123cf24304c47169
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69669


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 08afa7d3
......@@ -422,14 +422,14 @@ class TcaMigration
continue;
}
foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
if ((string)($fieldConfig['config']['type'] ?? '') != 'inline'
if ((string)($fieldConfig['config']['type'] ?? '') !== 'inline'
|| !isset($fieldConfig['config']['appearance']['showRemovedLocalizationRecords'])
) {
continue;
}
$this->messages[] = 'The TCA field \'' . $fieldName . '\' of table \'' . $table . '\' is '
. 'defined as type \'inline\' with the \'appearance.showRemovedLocalizationRecords\' option. This is not '
. 'evaluated anymore. There is no replacement and should therefore be removed.';
. 'defined as type \'inline\' with the \'appearance.showRemovedLocalizationRecords\' option set. '
. 'As this option is not evaluated anymore and no replacement exists, it should be removed from TCA.';
unset($fieldConfig['config']['appearance']['showRemovedLocalizationRecords']);
}
}
......
......@@ -821,7 +821,31 @@ class TcaMigrationTest extends UnitTestCase
'config' => [
'type' => 'inline',
'appearance' => [
'showRemovedLocalizationRecords' => 1
'showRemovedLocalizationRecords' => true
]
]
]
]
],
'bTable' => [
'columns' => [
'inlineField' => [
'config' => [
'type' => 'inline',
'appearance' => [
'showRemovedLocalizationRecords' => false
]
]
]
]
],
'cTable' => [
'columns' => [
'someField' => [
'config' => [
'type' => 'select',
'appearance' => [
'showRemovedLocalizationRecords' => true
]
]
]
......@@ -840,6 +864,28 @@ class TcaMigrationTest extends UnitTestCase
]
]
],
'bTable' => [
'columns' => [
'inlineField' => [
'config' => [
'type' => 'inline',
'appearance' => []
]
]
]
],
'cTable' => [
'columns' => [
'someField' => [
'config' => [
'type' => 'select',
'appearance' => [
'showRemovedLocalizationRecords' => true
]
]
]
]
],
];
$subject = new TcaMigration();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment