Skip to content

Commit

Permalink
Closes CodersCare#1
Browse files Browse the repository at this point in the history
Work on `$event->getTca()` instead of `$GLOBALS['TCA']`. Back up the previous TCA in case other listeners depend on it.
  • Loading branch information
luzat authored Aug 16, 2022
1 parent 4957a7c commit f784f0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/EventListener/ExtTablesInclusionPostProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ class ExtTablesInclusionPostProcessing
*/
public function __invoke(AfterTcaCompilationEvent $event): void
{
$tcaBackup = $GLOBALS['TCA'];
$GLOBALS['TCA'] = $event->getTca();

ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'recursive', 'shortcut', 'after:records');
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:gridElements,tx_gridelements_container,tx_gridelements_columns'
);

$event->setTca($GLOBALS['TCA']);
$GLOBALS['TCA'] = $tcaBackup;
}
}

0 comments on commit f784f0a

Please sign in to comment.