TcaMigration
Migrate TCA from old to new syntax.
Used in bootstrap and Flex Form Data Structures. This is to migrate from "old" to "new" TCA syntax, all methods must add a deprecation message if they change something.
Class and API may change any time.
Table of Contents
Properties
- $messages : array<string|int, mixed>
- Accumulate migration messages
Methods
- getMessages() : array<string|int, mixed>
- Get messages of migrated fields. Can be used for deprecation messages after migrate() was called.
- migrate() : array<string|int, mixed>
- Run some general TCA validations, then migrate old TCA to new TCA.
- migrateAuthMode() : array<string|int, mixed>
- See if ['columns'][aField]['config']['authMode'] is not set to 'explicitAllow' and set it to this value if needed.
- migrateColumnsConfig() : array<string|int, mixed>
- Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config
- migrateEmailFlagToEmailType() : array<string|int, mixed>
- Migrates [config][eval] = 'email' to [config][type] = 'email' and removes 'email' from [config][eval].
- migrateEvalIntAndDouble2ToTypeNumber() : array<string|int, mixed>
- Migrates [config][eval] = 'int' and [config][eval] = 'double2' to [config][type] = 'number'.
- migrateFalHandlingInInlineToTypeFile() : array<string|int, mixed>
- Migrates type='inline' with foreign_table='sys_file_reference' to type='file'.
- migrateFileFolderConfiguration() : array<string|int, mixed>
- Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.
- migrateInternalTypeFolderToTypeFolder() : array<string|int, mixed>
- Migrates [config][internal_type] = 'folder' to [config][type] = 'folder'.
- migrateItemsToAssociativeArray() : array<string|int, mixed>
- Converts the item list of type "select", "radio" and "check" to an associated array.
- migrateLanguageFieldToTcaTypeLanguage() : array<string|int, mixed>
- Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'
- migrateLevelLinksPosition() : array<string|int, mixed>
- 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.
- migrateNullFlag() : array<string|int, mixed>
- Migrates [config][eval] = 'null' to [config][nullable] = true and removes 'null' from [config][eval].
- migratePagesLanguageOverlayRemoval() : array<string|int, mixed>
- Removes $TCA['pages_language_overlay'] if defined.
- migratePasswordAndSaltedPasswordToPasswordType() : array<string|int, mixed>
- Migrates [config][eval] = 'password' and [config][eval] = 'saltedPassword' to [config][type] = 'password' Sets option "hashed" to FALSE if "saltedPassword" is not set for "password" Removes option [config][eval].
- migrateRenderTypeColorpickerToTypeColor() : array<string|int, mixed>
- Migrates [config][renderType] = 'colorpicker' to [config][type] = 'color'.
- migrateRenderTypeInputDateTimeToTypeDatetime() : array<string|int, mixed>
- Migrates [config][renderType] = 'inputDateTime' to [config][type] = 'datetime'.
- migrateRenderTypeInputLinkToTypeLink() : array<string|int, mixed>
- Migrates [config][renderType] = 'inputLink' to [config][type] = 'link'.
- migrateRequiredFlag() : array<string|int, mixed>
- Migrates [config][eval] = 'required' to [config][required] = true and removes 'required' from [config][eval].
- migrateRootUidToStartingPoints() : array<string|int, mixed>
- If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.
- migrateSpecialLanguagesToTcaTypeLanguage() : array<string|int, mixed>
- Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'
- migrateT3EditorToCodeEditor() : array<string|int, mixed>
- migrateTypeNoneColsToSize() : array<string|int, mixed>
- Migrates type => "none" [config][cols] to [config][size] and removes "cols".
- removeAllowLanguageSynchronizationFromColumnsOverrides() : array<string|int, mixed>
- Setting "allowLanguageSynchronization" for columns via columnsOverride is currently not supported see Localization\State and therefore leads to an exception in the LocalizationStateSelector wizard.
- removeAlwaysDescription() : array<string|int, mixed>
- Removes ['interface']['always_description'] and also ['interface'] if `always_description` was the only key in the array.
- removeAuthModeEnforce() : array<string|int, mixed>
- Remove ['columns'][aField]['config']['authMode_enforce']
- removeCtrlCruserId() : array<string|int, mixed>
- Remove ['ctrl']['cruser_id'].
- removeEnableMultiSelectFilterTextfieldConfiguration() : array<string|int, mixed>
- Removes configuration removeEnableMultiSelectFilterTextfield
- removeExcludeFieldForTransOrigPointerField() : array<string|int, mixed>
- Removes $TCA[$mytable][columns][_transOrigPointerField_][exclude] if defined
- removeFalRelatedElementBrowserOptions() : array<string|int, mixed>
- Removes the [appearance][elementBrowserType] and [appearance][elementBrowserAllowed] options from TCA type "group" fields.
- removeFalRelatedOptionsFromTypeInline() : array<string|int, mixed>
- Removes the following options from TCA type "inline" fields: - [appearance][headerThumbnail] - [appearance][fileUploadAllowed] - [appearance][fileByUrlAllowed]
- removeMmHasUidField() : array<string|int, mixed>
- removeMmInsertFields() : array<string|int, mixed>
- removePassContentFromTypeNone() : array<string|int, mixed>
- Removes ['config']['pass_content'] from TCA type "none" fields
- removeSelectAuthModeIndividualItemsKeyword() : array<string|int, mixed>
- If a column has authMode=individual and items with the corresponding key on position 5 defined, or if EXPL_ALLOW or EXPL_DENY is set for position 6, migrate or remove them.
- removeSelIconFieldPath() : array<string|int, mixed>
- Removes $TCA[$mytable][ctrl][selicon_field_path]
- removeSetToDefaultOnCopy() : array<string|int, mixed>
- Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]
- removeShowRecordFieldListField() : array<string|int, mixed>
- Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface'] if `showRecordFieldList` was the only key in the array.
- removeShowRemovedLocalizationRecords() : array<string|int, mixed>
- removeSubTypesConfiguration() : void
- Removes the following sub types configuration options:
- removeWorkspacePlaceholderShadowColumnsConfiguration() : array<string|int, mixed>
- Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]
- validateTcaType() : void
- Check for required TCA configuration
Properties
$messages
Accumulate migration messages
protected
array<string|int, mixed>
$messages
= []
Methods
getMessages()
Get messages of migrated fields. Can be used for deprecation messages after migrate() was called.
public
getMessages() : array<string|int, mixed>
Return values
array<string|int, mixed> —Migration messages
migrate()
Run some general TCA validations, then migrate old TCA to new TCA.
public
migrate(array<string|int, mixed> $tca) : array<string|int, mixed>
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<string|int, mixed>
Return values
array<string|int, mixed>migrateAuthMode()
See if ['columns'][aField]['config']['authMode'] is not set to 'explicitAllow' and set it to this value if needed.
protected
migrateAuthMode(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateColumnsConfig()
Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config
protected
migrateColumnsConfig(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
-
Incoming TCA
Return values
array<string|int, mixed>migrateEmailFlagToEmailType()
Migrates [config][eval] = 'email' to [config][type] = 'email' and removes 'email' from [config][eval].
protected
migrateEmailFlagToEmailType(array<string|int, mixed> $tca) : array<string|int, mixed>
If [config][eval] contains 'trim', it will also be removed. If [config][eval] becomes empty, the option will be removed completely.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateEvalIntAndDouble2ToTypeNumber()
Migrates [config][eval] = 'int' and [config][eval] = 'double2' to [config][type] = 'number'.
protected
migrateEvalIntAndDouble2ToTypeNumber(array<string|int, mixed> $tca) : array<string|int, mixed>
The migration only applies to fields without a renderType defined. Adds [config][format] = "decimal" if [config][eval] = double2 Removes [config][eval]. Removes option [config][max], if set.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateFalHandlingInInlineToTypeFile()
Migrates type='inline' with foreign_table='sys_file_reference' to type='file'.
protected
migrateFalHandlingInInlineToTypeFile(array<string|int, mixed> $tca) : array<string|int, mixed>
Removes table relation related options. Removes no longer available appearance options. Detects usage of "customControls" hook. Migrates renamed appearance options. Migrates allowed file extensions.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateFileFolderConfiguration()
Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.
protected
migrateFileFolderConfiguration(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateInternalTypeFolderToTypeFolder()
Migrates [config][internal_type] = 'folder' to [config][type] = 'folder'.
protected
migrateInternalTypeFolderToTypeFolder(array<string|int, mixed> $tca) : array<string|int, mixed>
Also removes [config][internal_type] completely, if present.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateItemsToAssociativeArray()
Converts the item list of type "select", "radio" and "check" to an associated array.
protected
migrateItemsToAssociativeArray(array<string|int, mixed> $tca) : array<string|int, mixed>
// From: [ 0 => 'A label', 1 => 'value', 2 => 'icon-identifier', 3 => 'group1', 4 => 'a custom description' ]
// To: [ 'label' => 'A label', 'value' => 'value', 'icon' => 'icon-identifier', 'group' => 'group1', 'description' => 'a custom description' ]
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateLanguageFieldToTcaTypeLanguage()
Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'
protected
migrateLanguageFieldToTcaTypeLanguage(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateLevelLinksPosition()
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<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateNullFlag()
Migrates [config][eval] = 'null' to [config][nullable] = true and removes 'null' from [config][eval].
protected
migrateNullFlag(array<string|int, mixed> $tca) : array<string|int, mixed>
If [config][eval] becomes empty, it will be removed completely.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migratePagesLanguageOverlayRemoval()
Removes $TCA['pages_language_overlay'] if defined.
protected
migratePagesLanguageOverlayRemoval(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed> —the modified TCA structure
migratePasswordAndSaltedPasswordToPasswordType()
Migrates [config][eval] = 'password' and [config][eval] = 'saltedPassword' to [config][type] = 'password' Sets option "hashed" to FALSE if "saltedPassword" is not set for "password" Removes option [config][eval].
protected
migratePasswordAndSaltedPasswordToPasswordType(array<string|int, mixed> $tca) : array<string|int, mixed>
Removes option [config][max], if set. Removes option [config][search], if set.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateRenderTypeColorpickerToTypeColor()
Migrates [config][renderType] = 'colorpicker' to [config][type] = 'color'.
protected
migrateRenderTypeColorpickerToTypeColor(array<string|int, mixed> $tca) : array<string|int, mixed>
Removes [config][eval]. Removes option [config][max], if set.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateRenderTypeInputDateTimeToTypeDatetime()
Migrates [config][renderType] = 'inputDateTime' to [config][type] = 'datetime'.
protected
migrateRenderTypeInputDateTimeToTypeDatetime(array<string|int, mixed> $tca) : array<string|int, mixed>
Migrates "date", "time" and "timesec" from [config][eval] to [config][format]. Removes option [config][eval]. Removes option [config][max], if set. Removes option [config][format], if set. Removes option [config][default], if the default is the native "empty" value
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateRenderTypeInputLinkToTypeLink()
Migrates [config][renderType] = 'inputLink' to [config][type] = 'link'.
protected
migrateRenderTypeInputLinkToTypeLink(array<string|int, mixed> $tca) : array<string|int, mixed>
Migrates the [config][fieldConfig][linkPopup] to type specific configuration. Removes option [config][eval]. Removes option [config][max], if set. Removes option [config][softref], if set to "typolink".
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateRequiredFlag()
Migrates [config][eval] = 'required' to [config][required] = true and removes 'required' from [config][eval].
protected
migrateRequiredFlag(array<string|int, mixed> $tca) : array<string|int, mixed>
If [config][eval] becomes empty, it will be removed completely.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateRootUidToStartingPoints()
If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.
protected
migrateRootUidToStartingPoints(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateSpecialLanguagesToTcaTypeLanguage()
Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'
protected
migrateSpecialLanguagesToTcaTypeLanguage(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateT3EditorToCodeEditor()
protected
migrateT3EditorToCodeEditor(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>migrateTypeNoneColsToSize()
Migrates type => "none" [config][cols] to [config][size] and removes "cols".
protected
migrateTypeNoneColsToSize(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeAllowLanguageSynchronizationFromColumnsOverrides()
Setting "allowLanguageSynchronization" for columns via columnsOverride is currently not supported see Localization\State and therefore leads to an exception in the LocalizationStateSelector wizard.
protected
removeAllowLanguageSynchronizationFromColumnsOverrides(array<string|int, mixed> $tca) : array<string|int, mixed>
Therefore, the setting is removed for now and the integrator is informed accordingly.
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeAlwaysDescription()
Removes ['interface']['always_description'] and also ['interface'] if `always_description` was the only key in the array.
protected
removeAlwaysDescription(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeAuthModeEnforce()
Remove ['columns'][aField]['config']['authMode_enforce']
protected
removeAuthModeEnforce(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeCtrlCruserId()
Remove ['ctrl']['cruser_id'].
protected
removeCtrlCruserId(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeEnableMultiSelectFilterTextfieldConfiguration()
Removes configuration removeEnableMultiSelectFilterTextfield
protected
removeEnableMultiSelectFilterTextfieldConfiguration(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed> —the modified TCA structure
removeExcludeFieldForTransOrigPointerField()
Removes $TCA[$mytable][columns][_transOrigPointerField_][exclude] if defined
protected
removeExcludeFieldForTransOrigPointerField(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeFalRelatedElementBrowserOptions()
Removes the [appearance][elementBrowserType] and [appearance][elementBrowserAllowed] options from TCA type "group" fields.
protected
removeFalRelatedElementBrowserOptions(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeFalRelatedOptionsFromTypeInline()
Removes the following options from TCA type "inline" fields: - [appearance][headerThumbnail] - [appearance][fileUploadAllowed] - [appearance][fileByUrlAllowed]
protected
removeFalRelatedOptionsFromTypeInline(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeMmHasUidField()
protected
removeMmHasUidField(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeMmInsertFields()
protected
removeMmInsertFields(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removePassContentFromTypeNone()
Removes ['config']['pass_content'] from TCA type "none" fields
protected
removePassContentFromTypeNone(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeSelectAuthModeIndividualItemsKeyword()
If a column has authMode=individual and items with the corresponding key on position 5 defined, or if EXPL_ALLOW or EXPL_DENY is set for position 6, migrate or remove them.
protected
removeSelectAuthModeIndividualItemsKeyword(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeSelIconFieldPath()
Removes $TCA[$mytable][ctrl][selicon_field_path]
protected
removeSelIconFieldPath(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed> —the modified TCA structure
removeSetToDefaultOnCopy()
Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]
protected
removeSetToDefaultOnCopy(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed> —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<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeShowRemovedLocalizationRecords()
protected
removeShowRemovedLocalizationRecords(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>removeSubTypesConfiguration()
Removes the following sub types configuration options:
protected
removeSubTypesConfiguration(array<string|int, mixed> $tca) : void
- subtype_value_field
- subtypes_addlist
- subtypes_excludelist
Parameters
- $tca : array<string|int, mixed>
removeWorkspacePlaceholderShadowColumnsConfiguration()
Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]
protected
removeWorkspacePlaceholderShadowColumnsConfiguration(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed> —the modified TCA structure
validateTcaType()
Check for required TCA configuration
protected
validateTcaType(array<string|int, mixed> $tca) : void
Parameters
- $tca : array<string|int, mixed>
-
Incoming TCA