Bug #80719

InlineOverrideChildTca migration is incomplete

Added by Georg Ringer over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-04-06
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

After #80000 the TCA changed for overriding childs. However the migration is incomplete.

As an example clone https://github.com/georgringer/news with sha1 ff576cd77f27d2047e4d7a04303dd6ab038b10b6 and check out news > sys_file_reference: The checkbox "showinpreview" is not there.

TCA of this part

        'fal_media' => [
            'exclude' => true,
            'l10n_mode' => 'mergeIfNotBlank',
            'label' => $ll . 'tx_news_domain_model_news.fal_media',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                'fal_media',
                [
                    'appearance' => [
                        'createNewRelationLinkTitle' => $ll . 'tx_news_domain_model_news.fal_media.add',
                        'showPossibleLocalizationRecords' => true,
                        'showRemovedLocalizationRecords' => true,
                        'showAllLocalizationLink' => true,
                        'showSynchronizationLink' => true
                    ],
                    'foreign_match_fields' => [
                        'fieldname' => 'fal_media',
                        'tablenames' => 'tx_news_domain_model_news',
                        'table_local' => 'sys_file',
                    ],
                    // custom configuration for displaying fields in the overlay/reference table
                    // to use the newsPalette and imageoverlayPalette instead of the basicoverlayPalette
                    'foreign_types' => [
                        '0' => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
                            'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
                        ]
                    ]
                ],
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']
            )
        ],

the types are completely missing in final TCA overrideChildTca


Related issues

Related to TYPO3 Core - Bug #80000: Unify configuration for overriding child TCA Closed 2017-02-24
Related to TYPO3 Core - Bug #81045: Textmedia - Elements without Cropping Tool Closed 2017-04-27

Associated revisions

Revision b6c72882 (diff)
Added by Malte Koitka about 2 years ago

[BUGFIX] TcaMigration should not skip on existing overrideChildTca

If an overideChildTca key is already added by a TYPO3 core
function like ExtensionManagementUtility::getFileFieldTCAConfig()
the TCA migration should not be skipped. Otherwise the config will
be incomplete and result in missing fields.

The migration is changed that old "foreign_types",
"foreign_selector_fieldTcaOverride" and "foreign_record_defaults"
are merged into new "overrideChildTca", but the new settings
are keps (take precedence) if given.

Resolves: #80719
Resolves: #81045
Releases: master, 8.7
Change-Id: Ic8a0338e0a9882b3b1e7abcd3123fbd7aa2b3505
Reviewed-on: https://review.typo3.org/52693
Tested-by: TYPO3com <>
Reviewed-by: Helmut Hummel <>
Reviewed-by: Henning Liebe <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 5b40db8e (diff)
Added by Malte Koitka about 2 years ago

[BUGFIX] TcaMigration should not skip on existing overrideChildTca

If an overideChildTca key is already added by a TYPO3 core
function like ExtensionManagementUtility::getFileFieldTCAConfig()
the TCA migration should not be skipped. Otherwise the config will
be incomplete and result in missing fields.

The migration is changed that old "foreign_types",
"foreign_selector_fieldTcaOverride" and "foreign_record_defaults"
are merged into new "overrideChildTca", but the new settings
are keps (take precedence) if given.

Resolves: #80719
Resolves: #81045
Releases: master, 8.7
Change-Id: Ic8a0338e0a9882b3b1e7abcd3123fbd7aa2b3505
Reviewed-on: https://review.typo3.org/54582
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Georg Ringer over 2 years ago

  • Description updated (diff)

#2 Updated by Malte Koitka over 2 years ago

EXT:mask is experiencing the same problem (see #80696) and every other extension using ExtensionManagementUtility::getFileFieldTCAConfig() to generate FAL TCA will eventually run into it.

Inside this function a subkey for "overrideChildTca" is created with some appearance settings [1].

The problem here is TcaMigration::migrateInlineOverrideChildTca() assuming that no migration must be done if there already is an existing key "overrideChildTca". [2]

With this issue in mind I wonder if it's safe to just remove that part of the condition.

[1] https://github.com/TYPO3/TYPO3.CMS/blob/8cd574ee39bf5dc6a13f54dae163ec00055e1ad4/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php#L542
[2] https://github.com/TYPO3/TYPO3.CMS/blob/9478d8817f575cf46369b926739759b53ae400c4/typo3/sysext/core/Classes/Migrations/TcaMigration.php#L2475

#4 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52693

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52693

#6 Updated by Christian Kuhn about 2 years ago

  • Related to Bug #81045: Textmedia - Elements without Cropping Tool added

#7 Updated by Gerrit Code Review about 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52693

#8 Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52693

#9 Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54582

#10 Updated by Malte Koitka about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#11 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF