Deprecation: #108557 - TCA option allowedRecordTypes for Page Types
See forge#108557
Description
The following methods of
\TYPO3\
have been marked as deprecated:
PageDoktype Registry->add () PageDoktype Registry->add Allowed Record Types () PageDoktype Registry->does Doktype Only Allow Specified Record Types ()
Impact
Calling any of the above mentioned methods will trigger a deprecation-level log entry and will result in a fatal PHP error in TYPO3 v15.0.
Affected installations
All installations using the
Page to configure Page Types
using the
add method. Or, in some rare cases, using the
methods
add or
does.
Migration
A new TCA option is introduced to configure allowed record types for pages:
Before:
$dokTypeRegistry = GeneralUtility::makeInstance(PageDoktypeRegistry::class);
$dokTypeRegistry->add(
116,
[
'allowedTables' => '*',
],
);
After:
$GLOBALS['TCA']['pages']['types']['116']['allowedRecordTypes'] = ['*'];
The array can contain a list of table names or a single entry with an asterisk *
to allow all types. If no second argument was provided to the
add method,
then the specific configuration can be omitted, as it will fall back to the
default allowed records.
Also note that Page Types are registered through TCA types. The former usage of
Page was only useful to define allowed record types
different to the default.
The option
allowed is only evaluated within the "pages" table.