Bug #88519

Wrong image reference handling during flexform translation in workspaces

Added by DMK E-BUSINESS GmbH 2 months ago. Updated 2 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2019-06-07
Due date:
% Done:

0%

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

Description

References in flexforms having type=inline are not processed correctly
during translations in workspaces as the remapping is not done. It's only done for group and select fields inside the flexform.

When a content element is translated in a draft workspace containing FAL references in a flexform inline field the references of the translation gets moved to the content element with default language upon publishing. As long as the content elements are in the draft workspace everything is fine.
This is due to the fact that the file reference of the new place holder version (t3ver_state = -1) of the translated content element is pointing to the content element (uid_foreign) in the default language. The value of uid_foreign for the draft version reference is correct.

Steps to reproduce:
1. Add an extension with a plugin and a flexform for that plugin.
2. Add an inline image field in flexform like the following:

<image>
    <TCEforms>
        <label>Add image</label>
        <config>
        <type>inline</type>
        <appearance type="array">
            <createNewRelationLinkTitle>Image</createNewRelationLinkTitle>
            <enabledControls type="array">
                <delete>1</delete>
                <dragdrop>1</dragdrop>
                <hide>1</hide>
                <info>1</info>
                <localize>1</localize>
            </enabledControls>
            <headerThumbnail type="array">
                <field>uid_local</field>
                <height>45c</height>
                <width>45</width>
            </headerThumbnail>
            <useSortable>1</useSortable>
        </appearance>
        <behaviour type="array">
            <localizationMode>select</localizationMode>
            <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
        </behaviour>
        <filter type="array">
        </filter>
        <foreign_field>uid_foreign</foreign_field>
        <foreign_label>uid_local</foreign_label>
        <foreign_match_fields type="array">
            <fieldname>galleryImage</fieldname>
        </foreign_match_fields>
        <foreign_selector>uid_local</foreign_selector>
        <foreign_selector_fieldTcaOverride type="array">
            <config type="array">
                <appearance type="array">
                    <elementBrowserAllowed>jpg,jpeg,png,gif,svg</elementBrowserAllowed>
                    <elementBrowserType>file</elementBrowserType>
                </appearance>
           </config>
        </foreign_selector_fieldTcaOverride>
        <foreign_sortby>sorting_foreign</foreign_sortby>
        <foreign_table>sys_file_reference</foreign_table>
        <foreign_table_field>tablenames</foreign_table_field>
        <foreign_types type="array">
            <numIndex index="0" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
            <numIndex index="1" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
            <numIndex index="2" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
            <numIndex index="3" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
            <numIndex index="4" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
            <numIndex index="5" type="array">
                <showitem>--palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
        </foreign_types>
        <maxitems>1</maxitems>
        <minitems>0</minitems>
        </config>
    </TCEforms>
</image>

3. Set up workspaces to have at least a draft workspace.
4. Switch to non-live workspace and create a plugin record for the default language.
5. Add an image reference.
6. Translate the record. At this point everything looks okay. But in the database the new version placeholder (t3ver_state = -1) of the translated file reference (sys_file_reference) points to the plugin record in the default language not to the record in the translated language. The file reference record for the draft workspace version points to the correct record.
7. Publish changes to live. The file references of the translated plugin record get moved to the default plugin record leaving the translation without references and the default record with 2 references.

I hope I explained it well enough to understand the problem.

Can also be reproduced with the gridelements extension. If there is a container with inline FAL references this happens, too.

P.S. I found the solution through the issue #59664 as there seemed to be a similar problem.

History

#1 Updated by Gerrit Code Review 2 months ago

  • Status changed from New 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/c/Packages/TYPO3.CMS/+/60898

#2 Updated by DMK E-BUSINESS GmbH 2 months ago

  • Description updated (diff)

Also available in: Atom PDF