Commit 7ed0d184 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Georg Ringer
Browse files

[TASK] Add TcaMigration for showRecordFieldList field

In #88901 the `showRecordFieldList` field was removed from all core
tables and won't be evaluated anymore. A corresponing TcaMigration
is therefore added.

Resolves: #90498
Related: #88901
Releases: master
Change-Id: Ife2ce2374e16bd981c9d77da285506542a1b1168
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63381


Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent b4b6dbbd
......@@ -54,6 +54,7 @@ class TcaMigration
$tca = $this->sanitizeControlSectionIntegrity($tca);
$tca = $this->removeEnableMultiSelectFilterTextfieldConfiguration($tca);
$tca = $this->removeExcludeFieldForTransOrigPointerField($tca);
$tca = $this->removeShowRecordFieldListField($tca);
return $tca;
}
......@@ -296,4 +297,28 @@ class TcaMigration
return $tca;
}
/**
* Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface']
* if `showRecordFieldList` was the only key in the array.
*
* @param array $tca
* @return array
*/
protected function removeShowRecordFieldListField(array $tca): array
{
foreach ($tca as $table => &$configuration) {
if (!isset($configuration['interface']['showRecordFieldList'])) {
continue;
}
$this->messages[] = 'The \'' . $table . '\' TCA configuration \'showRecordFieldList\''
. ' inside the section \'interface\' is not evaluated anymore and should therefore be removed.';
unset($configuration['interface']['showRecordFieldList']);
if ($configuration['interface'] === []) {
unset($configuration['interface']);
}
}
return $tca;
}
}
......@@ -9,12 +9,17 @@ See :issue:`88901`
Description
===========
The element information modal now shows all fields of the current record and the selected type.
The element information modal now shows all fields of the current record and
the selected type.
Impact
======
The TCA configuration `showRecordFieldList` inside the section `interface` is not evaluated anymore and all occurences have been removed.
The TCA configuration `showRecordFieldList` inside the section `interface` is
not evaluated anymore and all occurences have been removed.
A migration wizard is available that removes the option from your TCA and adds
a deprecation message to the deprecation log where code adaption has to take place.
.. index:: Backend
......@@ -488,7 +488,7 @@ class TcaMigrationTest extends UnitTestCase
$input = [
'aTable' => [
'ctrl' => [
'transOrigPointerField' => 'l10n_parent'
'transOrigPointerField' => 'l10n_parent'
],
'columns' => [
'l10n_parent' => [
......@@ -561,4 +561,37 @@ class TcaMigrationTest extends UnitTestCase
$subject = new TcaMigration();
self::assertEquals($expected, $subject->migrate($input));
}
/**
* @test
*/
public function removeShowRecordFieldListFieldIsRemoved(): void
{
$input = [
'aTable' => [
'interface' => [
'showRecordFieldList' => 'title,text,description',
]
],
'bTable' => [
'interface' => [
'showRecordFieldList' => 'title,text,description',
'maxDBListItems' => 30,
'maxSingleDBListItems' => 50
]
]
];
$expected = [
'aTable' => [
],
'bTable' => [
'interface' => [
'maxDBListItems' => 30,
'maxSingleDBListItems' => 50
]
]
];
$subject = new TcaMigration();
self::assertEquals($expected, $subject->migrate($input));
}
}
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