From ed431c4b06491aadb3dc5ea9efc3d4e91890409f Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Fri, 3 Apr 2026 13:43:23 +0200 Subject: [PATCH] [TASK] trigger deprecation for legacy restrictions --- Classes/Tca/Registry.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/Tca/Registry.php b/Classes/Tca/Registry.php index ba5ef71b..33302b31 100644 --- a/Classes/Tca/Registry.php +++ b/Classes/Tca/Registry.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider; use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider; use TYPO3\CMS\Core\Imaging\IconRegistry; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -83,6 +84,7 @@ public function configureContainer(ContainerConfiguration $containerConfiguratio public function getContentDefenderConfiguration(string $cType, int $colPos): array { $contentDefenderConfiguration = []; + $typo3Version = ((new Typo3Version())->getMajorVersion()); $rows = $this->getGrid($cType); foreach ($rows as $columns) { foreach ($columns as $column) { @@ -93,9 +95,15 @@ public function getContentDefenderConfiguration(string $cType, int $colPos): arr $contentDefenderConfiguration['disallowed.'] = $column['disallowed'] ?? []; $contentDefenderConfiguration['maxitems'] = $column['maxitems'] ?? 0; if ($contentDefenderConfiguration['allowedContentTypes'] === '' && $contentDefenderConfiguration['allowed.'] !== []) { + if ($typo3Version > 13) { + trigger_error('use allowedContentTypes instead of allowed.CType', E_USER_DEPRECATED); + } $contentDefenderConfiguration['allowedContentTypes'] = $contentDefenderConfiguration['allowed.']['CType'] ?? ''; } if ($contentDefenderConfiguration['disallowedContentTypes'] === '' && $contentDefenderConfiguration['disallowed.'] !== []) { + if ($typo3Version > 13) { + trigger_error('use disallowedContentTypes instead of disallowed.CType', E_USER_DEPRECATED); + } $contentDefenderConfiguration['disallowedContentTypes'] = $contentDefenderConfiguration['disallowed.']['CType'] ?? ''; } return $contentDefenderConfiguration;