‪TYPO3CMS  11.5
TYPO3\CMS\Core\Migrations\TcaMigration Class Reference

Public Member Functions

array migrate (array $tca)
 
array getMessages ()
 

Protected Member Functions

 validateTcaType (array $tca)
 
array migrateColumnsConfig (array $tca)
 
array migrateLocalizeChildrenAtParentLocalization (array $tca)
 
array migratePagesLanguageOverlayRemoval (array $tca)
 
array removeEnableMultiSelectFilterTextfieldConfiguration (array $tca)
 
array removeSelIconFieldPath (array $tca)
 
array removeSetToDefaultOnCopy (array $tca)
 
array sanitizeControlSectionIntegrity (array $tca)
 
array removeExcludeFieldForTransOrigPointerField (array $tca)
 
array removeShowRecordFieldListField (array $tca)
 
array removeWorkspacePlaceholderShadowColumnsConfiguration (array $tca)
 
array migrateLanguageFieldToTcaTypeLanguage (array $tca)
 
array migrateSpecialLanguagesToTcaTypeLanguage (array $tca)
 
 removeShowRemovedLocalizationRecords (array $tca)
 
array migrateFileFolderConfiguration (array $tca)
 
array migrateLevelLinksPosition (array $tca)
 
array migrateRootUidToStartingPoints (array $tca)
 
array migrateSelectAuthModeIndividualItemsKeywordToNewPosition (array $tca)
 

Protected Attributes

array $messages = array( )
 

Detailed Description

Migrate TCA from old to new syntax. Used in bootstrap and Flex Form Data Structures.

Class and API may change any time.

Definition at line 25 of file TcaMigration.php.

Member Function Documentation

◆ getMessages()

array TYPO3\CMS\Core\Migrations\TcaMigration::getMessages ( )

Get messages of migrated fields. Can be used for deprecation messages after migrate() was called.

Returns
‪array Migration messages

Definition at line 76 of file TcaMigration.php.

References TYPO3\CMS\Core\Migrations\TcaMigration\$messages.

◆ migrate()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrate ( array  $tca)

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

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
array$tca
Returns
‪array

Definition at line 46 of file TcaMigration.php.

References $tca, TYPO3\CMS\Core\Migrations\TcaMigration\migrateColumnsConfig(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateFileFolderConfiguration(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateLanguageFieldToTcaTypeLanguage(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateLevelLinksPosition(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateLocalizeChildrenAtParentLocalization(), TYPO3\CMS\Core\Migrations\TcaMigration\migratePagesLanguageOverlayRemoval(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateRootUidToStartingPoints(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateSelectAuthModeIndividualItemsKeywordToNewPosition(), TYPO3\CMS\Core\Migrations\TcaMigration\migrateSpecialLanguagesToTcaTypeLanguage(), TYPO3\CMS\Core\Migrations\TcaMigration\removeEnableMultiSelectFilterTextfieldConfiguration(), TYPO3\CMS\Core\Migrations\TcaMigration\removeExcludeFieldForTransOrigPointerField(), TYPO3\CMS\Core\Migrations\TcaMigration\removeSelIconFieldPath(), TYPO3\CMS\Core\Migrations\TcaMigration\removeSetToDefaultOnCopy(), TYPO3\CMS\Core\Migrations\TcaMigration\removeShowRecordFieldListField(), TYPO3\CMS\Core\Migrations\TcaMigration\removeShowRemovedLocalizationRecords(), TYPO3\CMS\Core\Migrations\TcaMigration\removeWorkspacePlaceholderShadowColumnsConfiguration(), TYPO3\CMS\Core\Migrations\TcaMigration\sanitizeControlSectionIntegrity(), and TYPO3\CMS\Core\Migrations\TcaMigration\validateTcaType().

◆ migrateColumnsConfig()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateColumnsConfig ( array  $tca)
protected

Find columns fields that don't have a 'config' section at all, add ['config']['type'] = 'none'; for those to enforce config

Parameters
array$tca‪Incoming TCA
Returns
‪array

Definition at line 110 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateFileFolderConfiguration()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateFileFolderConfiguration ( array  $tca)
protected

Moves the "fileFolder" configuration of TCA columns type=select into sub array "fileFolderConfig", while renaming those options.

Parameters
array$tca
Returns
‪array

Definition at line 450 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateLanguageFieldToTcaTypeLanguage()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateLanguageFieldToTcaTypeLanguage ( array  $tca)
protected

Replaces $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config] with $TCA[$mytable][columns][$TCA[$mytable][ctrl][languageField]][config][type] = 'language'

Parameters
array$tca
Returns
‪array

Definition at line 371 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateLevelLinksPosition()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateLevelLinksPosition ( array  $tca)
protected

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.

Parameters
array$tca
Returns
‪array

Definition at line 498 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateLocalizeChildrenAtParentLocalization()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateLocalizeChildrenAtParentLocalization ( array  $tca)
protected

Option $TCA[$table]['columns'][$columnName]['config']['behaviour']['localizeChildrenAtParentLocalization'] is always on, so this option can be removed.

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 137 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migratePagesLanguageOverlayRemoval()

array TYPO3\CMS\Core\Migrations\TcaMigration::migratePagesLanguageOverlayRemoval ( array  $tca)
protected

Removes $TCA['pages_language_overlay'] if defined.

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 175 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateRootUidToStartingPoints()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateRootUidToStartingPoints ( array  $tca)
protected

If a column has [treeConfig][rootUid] defined, migrate to [treeConfig][startingPoints] on the same level.

Parameters
array$tca
Returns
‪array

Definition at line 532 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateSelectAuthModeIndividualItemsKeywordToNewPosition()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateSelectAuthModeIndividualItemsKeywordToNewPosition ( array  $tca)
protected

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.

Parameters
array$tca
Returns
‪array

Definition at line 565 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ migrateSpecialLanguagesToTcaTypeLanguage()

array TYPO3\CMS\Core\Migrations\TcaMigration::migrateSpecialLanguagesToTcaTypeLanguage ( array  $tca)
protected

Replaces $TCA[$mytable][columns][field][config][special] = 'languages' with $TCA[$mytable][columns][field][config][type] = 'language'

Parameters
array$tca
Returns
‪array

Definition at line 397 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeEnableMultiSelectFilterTextfieldConfiguration()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeEnableMultiSelectFilterTextfieldConfiguration ( array  $tca)
protected

Removes configuration removeEnableMultiSelectFilterTextfield

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 192 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeExcludeFieldForTransOrigPointerField()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeExcludeFieldForTransOrigPointerField ( array  $tca)
protected

Removes $TCA[$mytable][columns][transOrigPointerField][exclude] if defined

Parameters
array$tca
Returns
‪array

Definition at line 298 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeSelIconFieldPath()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeSelIconFieldPath ( array  $tca)
protected

Removes $TCA[$mytable][ctrl][selicon_field_path]

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 218 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeSetToDefaultOnCopy()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeSetToDefaultOnCopy ( array  $tca)
protected

Removes $TCA[$mytable][ctrl][setToDefaultOnCopy]

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 237 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeShowRecordFieldListField()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeShowRecordFieldListField ( array  $tca)
protected

Removes $TCA[$mytable]['interface']['showRecordFieldList'] and also $TCA[$mytable]['interface'] if showRecordFieldList was the only key in the array.

Parameters
array$tca
Returns
‪array

Definition at line 321 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeShowRemovedLocalizationRecords()

TYPO3\CMS\Core\Migrations\TcaMigration::removeShowRemovedLocalizationRecords ( array  $tca)
protected

Definition at line 421 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ removeWorkspacePlaceholderShadowColumnsConfiguration()

array TYPO3\CMS\Core\Migrations\TcaMigration::removeWorkspacePlaceholderShadowColumnsConfiguration ( array  $tca)
protected

Removes $TCA[$mytable][ctrl][shadowColumnsForMovePlaceholders] and $TCA[$mytable][ctrl][shadowColumnsForNewPlaceholders]

Parameters
array$tca
Returns
‪array the modified TCA structure

Definition at line 345 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ sanitizeControlSectionIntegrity()

array TYPO3\CMS\Core\Migrations\TcaMigration::sanitizeControlSectionIntegrity ( array  $tca)
protected

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'].

The list of references to usages below is not necessarily complete.

Parameters
array$tca
Returns
‪array
See also
‪\TYPO3\CMS\Core\DataHandling\DataHandler::fillInFieldArray()

Definition at line 262 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

◆ validateTcaType()

TYPO3\CMS\Core\Migrations\TcaMigration::validateTcaType ( array  $tca)
protected

Check for required TCA configuration

Parameters
array$tca‪Incoming TCA

Definition at line 86 of file TcaMigration.php.

References $tca.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\migrate().

Member Data Documentation

◆ $messages

array TYPO3\CMS\Core\Migrations\TcaMigration::$messages = array( )
protected

Accumulate migration messages

Definition at line 31 of file TcaMigration.php.

Referenced by TYPO3\CMS\Core\Migrations\TcaMigration\getMessages().