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.

Internal

Class and API may change any time.

Table of Contents

Methods

migrate()  : TcaProcessingResult
Run some general TCA validations, then migrate old TCA to new TCA.
addWorkspaceAwarenessToInlineChildren()  : TcaProcessingResult
Inline foreign_table relations with a parent being workspace aware and a child not being workspace aware are not supported. The method detects this scenario in parent columns (not in flex forms) and enforces workspace awareness of child tables.
migrateAuthMode()  : TcaProcessingResult
See if ['columns'][aField]['config']['authMode'] is not set to 'explicitAllow' and set it to this value if needed.
migrateColumnsConfig()  : TcaProcessingResult
Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config
migrateEmailFlagToEmailType()  : TcaProcessingResult
Migrates [config][eval] = 'email' to [config][type] = 'email' and removes 'email' from [config][eval].
migrateEvalIntAndDouble2ToTypeNumber()  : TcaProcessingResult
Migrates [config][eval] = 'int' and [config][eval] = 'double2' to [config][type] = 'number'.
migrateFalHandlingInInlineToTypeFile()  : TcaProcessingResult
Migrates type='inline' with foreign_table='sys_file_reference' to type='file'.
migrateFileFolderConfiguration()  : TcaProcessingResult
Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.
migrateInternalTypeFolderToTypeFolder()  : TcaProcessingResult
Migrates [config][internal_type] = 'folder' to [config][type] = 'folder'.
migrateItemsOfValuePickerToAssociativeArray()  : TcaProcessingResult
Converts the item list of valuePicker to an associated array.
migrateItemsToAssociativeArray()  : TcaProcessingResult
Converts the item list of type "select", "radio" and "check" to an associated array.
migrateLanguageFieldToTcaTypeLanguage()  : TcaProcessingResult
Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'
migrateLevelLinksPosition()  : TcaProcessingResult
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()  : TcaProcessingResult
Migrates [config][eval] = 'null' to [config][nullable] = true and removes 'null' from [config][eval].
migratePagesLanguageOverlayRemoval()  : TcaProcessingResult
Removes $TCA['pages_language_overlay'] if defined.
migratePasswordAndSaltedPasswordToPasswordType()  : TcaProcessingResult
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()  : TcaProcessingResult
Migrates [config][renderType] = 'colorpicker' to [config][type] = 'color'.
migrateRenderTypeInputDateTimeToTypeDatetime()  : TcaProcessingResult
Migrates [config][renderType] = 'inputDateTime' to [config][type] = 'datetime'.
migrateRenderTypeInputLinkToTypeLink()  : TcaProcessingResult
Migrates [config][renderType] = 'inputLink' to [config][type] = 'link'.
migrateRequiredFlag()  : TcaProcessingResult
Migrates [config][eval] = 'required' to [config][required] = true and removes 'required' from [config][eval].
migrateRootUidToStartingPoints()  : TcaProcessingResult
If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.
migrateSingleDataStructureConfiguration()  : TcaProcessingResult
migrateSpecialLanguagesToTcaTypeLanguage()  : TcaProcessingResult
Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'
migrateT3EditorToCodeEditor()  : TcaProcessingResult
migrateTypeNoneColsToSize()  : TcaProcessingResult
Migrates type => "none" [config][cols] to [config][size] and removes "cols".
removeAllowLanguageSynchronizationFromColumnsOverrides()  : TcaProcessingResult
Setting "allowLanguageSynchronization" for columns via columnsOverride is currently not supported see Localization\State and therefore leads to an exception in the LocalizationStateSelector wizard.
removeAlwaysDescription()  : TcaProcessingResult
Removes ['interface']['always_description'] and also ['interface'] if `always_description` was the only key in the array.
removeAuthModeEnforce()  : TcaProcessingResult
Remove ['columns'][aField]['config']['authMode_enforce']
removeCtrlCruserId()  : TcaProcessingResult
Remove ['ctrl']['cruser_id'].
removeEnableMultiSelectFilterTextfieldConfiguration()  : TcaProcessingResult
Removes configuration removeEnableMultiSelectFilterTextfield
removeEvalYearFlag()  : TcaProcessingResult
Removes [config][eval] = 'year'.
removeExcludeFieldForTransOrigPointerField()  : TcaProcessingResult
Removes $TCA[$mytable][columns][_transOrigPointerField_][exclude] if defined
removeFalRelatedElementBrowserOptions()  : TcaProcessingResult
Removes the [appearance][elementBrowserType] and [appearance][elementBrowserAllowed] options from TCA type "group" fields.
removeFalRelatedOptionsFromTypeInline()  : TcaProcessingResult
Removes the following options from TCA type "inline" fields: - [appearance][headerThumbnail] - [appearance][fileUploadAllowed] - [appearance][fileByUrlAllowed]
removeFieldSearchConfigOptions()  : TcaProcessingResult
Removes $[config][search]
removeIsStaticControlOption()  : TcaProcessingResult
Removes $TCA[$mytable]['ctrl']['is_static']
removeMaxDBListItems()  : TcaProcessingResult
Removes $TCA[$mytable]['interface']['maxDBListItems'], and 'maxSingleDBListItems' and also $TCA[$mytable]['interface'] if `interface` is empty later-on.
removeMmHasUidField()  : TcaProcessingResult
removeMmInsertFields()  : TcaProcessingResult
removePassContentFromTypeNone()  : TcaProcessingResult
Removes ['config']['pass_content'] from TCA type "none" fields
removeSearchFieldsControlOption()  : TcaProcessingResult
Removes $TCA[$mytable]['ctrl']['searchFields']
removeSelectAuthModeIndividualItemsKeyword()  : TcaProcessingResult
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()  : TcaProcessingResult
Removes $TCA[$mytable][ctrl][selicon_field_path]
removeSetToDefaultOnCopy()  : TcaProcessingResult
Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]
removeShowRecordFieldListField()  : TcaProcessingResult
Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface'] if `showRecordFieldList` was the only key in the array.
removeShowRemovedLocalizationRecords()  : TcaProcessingResult
removeSubTypesConfiguration()  : TcaProcessingResult
Removes the following sub types configuration options:
removeWorkspacePlaceholderShadowColumnsConfiguration()  : TcaProcessingResult
Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]
validateTcaType()  : void
Check for required TCA configuration

Methods

migrate()

Run some general TCA validations, then migrate old TCA to new TCA.

public migrate(array<string|int, mixed> $tca) : TcaProcessingResult

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
TcaProcessingResult

addWorkspaceAwarenessToInlineChildren()

Inline foreign_table relations with a parent being workspace aware and a child not being workspace aware are not supported. The method detects this scenario in parent columns (not in flex forms) and enforces workspace awareness of child tables.

protected addWorkspaceAwarenessToInlineChildren(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult
Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

migrateEmailFlagToEmailType()

Migrates [config][eval] = 'email' to [config][type] = 'email' and removes 'email' from [config][eval].

protected migrateEmailFlagToEmailType(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

If [config][eval] contains 'trim', it will also be removed. If [config][eval] becomes empty, the option will be removed completely.

Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

migrateEvalIntAndDouble2ToTypeNumber()

Migrates [config][eval] = 'int' and [config][eval] = 'double2' to [config][type] = 'number'.

protected migrateEvalIntAndDouble2ToTypeNumber(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

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
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

migrateFalHandlingInInlineToTypeFile()

Migrates type='inline' with foreign_table='sys_file_reference' to type='file'.

protected migrateFalHandlingInInlineToTypeFile(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

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
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

migrateItemsToAssociativeArray()

Converts the item list of type "select", "radio" and "check" to an associated array.

protected migrateItemsToAssociativeArray(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

// 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
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

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(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult
Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

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(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

Removes option [config][max], if set. Removes option [config][search], if set.

Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

migrateRenderTypeInputDateTimeToTypeDatetime()

Migrates [config][renderType] = 'inputDateTime' to [config][type] = 'datetime'.

protected migrateRenderTypeInputDateTimeToTypeDatetime(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

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
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

Migrates [config][renderType] = 'inputLink' to [config][type] = 'link'.

protected migrateRenderTypeInputLinkToTypeLink(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

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
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

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(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult

Therefore, the setting is removed for now and the integrator is informed accordingly.

Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

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(TcaProcessingResult $tcaProcessingResult) : TcaProcessingResult
Parameters
$tcaProcessingResult : TcaProcessingResult
Return values
TcaProcessingResult

validateTcaType()

Check for required TCA configuration

protected validateTcaType(array<string|int, mixed> $tca) : void
Parameters
$tca : array<string|int, mixed>

        
On this page

Search results