TcaMigration
class \
Migrate TCA from old to new syntax. Used in bootstrap and Flex Form Data Structures.
Internal
Class and API may change any time.
Table of Contents
Properties
- $messages : array
- Accumulate migration messages
Methods
- getMessages() : array
- Get messages of migrated fields. Can be used for deprecation messages after migrate() was called.
- migrate() : array
- Run some general TCA validations, then migrate old TCA to new TCA.
- migrateColumnsConfig() : array
- Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config
- migrateFileFolderConfiguration() : array
- Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.
- migrateLanguageFieldToTcaTypeLanguage() : array
- Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'
- migrateLevelLinksPosition() : array
- The [appearance][levelLinksPosition] option can be used to select the position of the level links. This option was previously misused to disable all those links by setting it to "none". Since all of those links can be disabled by a dedicated option, e.g. showNewRecordLink, this wizard sets those options to false and unsets the invalid levelLinksPosition value.
- migrateLocalizeChildrenAtParentLocalization() : array
- Option $TCA[$table]['columns'][$columnName]['config']['behaviour']['localizeChildrenAtParentLocalization'] is always on, so this option can be removed.
- migratePagesLanguageOverlayRemoval() : array
- Removes $TCA['pages_language_overlay'] if defined.
- migrateRootUidToStartingPoints() : array
- If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.
- migrateSelectAuthModeIndividualItemsKeywordToNewPosition() : array
- If a column has authMode=individual and items with the corresponding key on position 5 defined, migrate the key to position 6, since position 5 is used for the description.
- migrateSpecialLanguagesToTcaTypeLanguage() : array
- Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'
- removeEnableMultiSelectFilterTextfieldConfiguration() : array
- Removes configuration removeEnableMultiSelectFilterTextfield
- removeExcludeFieldForTransOrigPointerField() : array
- Removes $TCA[$mytable][columns][_transOrigPointerField_][exclude] if defined
- removeSelIconFieldPath() : array
- Removes $TCA[$mytable][ctrl][selicon_field_path]
- removeSetToDefaultOnCopy() : array
- Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]
- removeShowRecordFieldListField() : array
- Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface'] if `showRecordFieldList` was the only key in the array.
- removeShowRemovedLocalizationRecords() : array
- removeWorkspacePlaceholderShadowColumnsConfiguration() : array
- Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]
- sanitizeControlSectionIntegrity() : array
- Ensures that system internal columns that are required for data integrity (e.g. localize or copy a record) are available in case they have been defined in $GLOBALS['TCA'][<table-name>]['ctrl'].
- validateTcaType() : mixed
- Check for required TCA configuration
Properties
$messages
Accumulate migration messages
protected
array
$messages
= []
Methods
getMessages()
Get messages of migrated fields. Can be used for deprecation messages after migrate() was called.
public
getMessages() : array
Return values
array —Migration messages
migrate()
Run some general TCA validations, then migrate old TCA to new TCA.
public
migrate(array $tca) : array
This class is typically called within bootstrap with empty caches after all TCA files from extensions have been loaded. The migration is then applied and the migrated result is cached. For flex form TCA, this class is called dynamically if opening a record in the backend.
See unit tests for details.
Parameters
- $tca : array
Return values
arraymigrateColumnsConfig()
Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config
protected
migrateColumnsConfig(array $tca) : array
Parameters
- $tca : array
-
Incoming TCA
Return values
arraymigrateFileFolderConfiguration()
Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.
protected
migrateFileFolderConfiguration(array $tca) : array
Parameters
- $tca : array
Return values
arraymigrateLanguageFieldToTcaTypeLanguage()
Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'
protected
migrateLanguageFieldToTcaTypeLanguage(array $tca) : array
Parameters
- $tca : array
Return values
arraymigrateLevelLinksPosition()
The [appearance][levelLinksPosition] option can be used to select the position of the level links. This option was previously misused to disable all those links by setting it to "none". Since all of those links can be disabled by a dedicated option, e.g. showNewRecordLink, this wizard sets those options to false and unsets the invalid levelLinksPosition value.
protected
migrateLevelLinksPosition(array $tca) : array
Parameters
- $tca : array
Return values
arraymigrateLocalizeChildrenAtParentLocalization()
Option $TCA[$table]['columns'][$columnName]['config']['behaviour']['localizeChildrenAtParentLocalization'] is always on, so this option can be removed.
protected
migrateLocalizeChildrenAtParentLocalization(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
migratePagesLanguageOverlayRemoval()
Removes $TCA['pages_language_overlay'] if defined.
protected
migratePagesLanguageOverlayRemoval(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
migrateRootUidToStartingPoints()
If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.
protected
migrateRootUidToStartingPoints(array $tca) : array
Parameters
- $tca : array
Return values
arraymigrateSelectAuthModeIndividualItemsKeywordToNewPosition()
If a column has authMode=individual and items with the corresponding key on position 5 defined, migrate the key to position 6, since position 5 is used for the description.
protected
migrateSelectAuthModeIndividualItemsKeywordToNewPosition(array $tca) : array
Parameters
- $tca : array
Return values
arraymigrateSpecialLanguagesToTcaTypeLanguage()
Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'
protected
migrateSpecialLanguagesToTcaTypeLanguage(array $tca) : array
Parameters
- $tca : array
Return values
arrayremoveEnableMultiSelectFilterTextfieldConfiguration()
Removes configuration removeEnableMultiSelectFilterTextfield
protected
removeEnableMultiSelectFilterTextfieldConfiguration(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
removeExcludeFieldForTransOrigPointerField()
Removes $TCA[$mytable][columns][_transOrigPointerField_][exclude] if defined
protected
removeExcludeFieldForTransOrigPointerField(array $tca) : array
Parameters
- $tca : array
Return values
arrayremoveSelIconFieldPath()
Removes $TCA[$mytable][ctrl][selicon_field_path]
protected
removeSelIconFieldPath(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
removeSetToDefaultOnCopy()
Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]
protected
removeSetToDefaultOnCopy(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
removeShowRecordFieldListField()
Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface'] if `showRecordFieldList` was the only key in the array.
protected
removeShowRecordFieldListField(array $tca) : array
Parameters
- $tca : array
Return values
arrayremoveShowRemovedLocalizationRecords()
protected
removeShowRemovedLocalizationRecords(array $tca) : array
Parameters
- $tca : array
Return values
arrayremoveWorkspacePlaceholderShadowColumnsConfiguration()
Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]
protected
removeWorkspacePlaceholderShadowColumnsConfiguration(array $tca) : array
Parameters
- $tca : array
Return values
array —the modified TCA structure
sanitizeControlSectionIntegrity()
Ensures that system internal columns that are required for data integrity (e.g. localize or copy a record) are available in case they have been defined in $GLOBALS['TCA'][<table-name>]['ctrl'].
protected
sanitizeControlSectionIntegrity(array $tca) : array
The list of references to usages below is not necessarily complete.
Parameters
- $tca : array
Tags
Return values
arrayvalidateTcaType()
Check for required TCA configuration
protected
validateTcaType(array $tca) : mixed
Parameters
- $tca : array
-
Incoming TCA