Skip to content

Commit

Permalink
[TASK] Prevent override of existing type or typeicon_column
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov committed Dec 4, 2024
1 parent b2fdf25 commit e92d866
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/Generator/TcaGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,12 @@ protected function generateTableTca(TableDefinition $tableDefinition, array $bas
if ($tableDefinition->hasTypeField()) {
// Ensure "type" is always set when a type field exists. This could be missing when an existing
// record is extended with a new record type.
$tca['ctrl']['type'] ??= $tableDefinition->getTypeField();
$tca['ctrl']['typeicon_column'] ??= $tableDefinition->getTypeField();
if ($isNewTable || !isset($baseTca[$tableDefinition->getTable()]['ctrl']['type'])) {
$tca['ctrl']['type'] ??= $tableDefinition->getTypeField();
}
if ($isNewTable || !isset($baseTca[$tableDefinition->getTable()]['ctrl']['typeicon_column'])) {
$tca['ctrl']['typeicon_column'] ??= $tableDefinition->getTypeField();
}
}
}
if ($tableDefinition->getContentType() === ContentType::CONTENT_ELEMENT && $typeDefinition->hasColumn('bodytext')) {
Expand Down

0 comments on commit e92d866

Please sign in to comment.