Bug #82221

Copying records with "flex" fields containing FAL IRRE relations fails to move copies to new parent upon workspace publishing

Added by Claus Due over 1 year ago. Updated 11 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2017-08-28
Due date:
% Done:

0%

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

Description

Prerequisites:

  • Content element with flexform
  • At least one field of type "inline" wanting FAL references
  • A draft workspace

Reproduction, first symptom:

  • Switch to live workspace
  • Create an instance of the content type
  • Fill in at least one FAL relation, best two or more (count of relations is a symptom and having one single relation may confuse)
  • Switch to draft workspace
  • Copy the content element, does not matter where to
  • Observe first symptom: draft record's "pi_flexform" column contains an incorrect FAL reference value (CSV list of UIDs, or single UID, instead of count). Placeholder record contains the correct FAL reference value (number of references). Copies of file relations in sys_file_reference have the correct uid_local value (pointing to the new, copied record).
  • Editing either the original or the copy of the parent record shows the expected relations (note 1)

Reproduction, second symptom:

  • Switch to the workspaces module
  • Perform publishing of all pending changes
  • Observe the second symptom: original record now has double the original file relations and the copy of the parent record has no file relations (uid_local of copies created in sys_file_reference now point to original instead of placeholder)
  • Both backend and frontend now display double relations for original record and no relations for copy of record (note 2).

Notes:

  • Note 1: The expected relations are resolved from the placeholder record which has the correct values, so the GUI shows these relations correctly but the DB data is corrupted.
  • Note 2: The incorrect values get set as part of the "publish workspace" step. The column is NOT in the list of shadow columns (but adding it makes no difference).

Solution:

The solution appears to be adding the UID of the newly created placeholder record as target UID in the substNEWwithIDs array in DataHandler. This one line of code causes both of the symptoms to disappear - the correct relationship UID is then read from the placeholder record and translated to the UID of the copy of the parent record. The code comment immediately outside the condition that checks if a placeholder was created even states that the UID gets recorded, but that currently is not the case. Adding the UID does exactly that.

Issue may exist as far back as TYPO3 7.6 but has been tested on 8.7 and master only. Both exhibit the same symptoms.

testce.zip (4.42 KB) Claus Due, 2017-08-28 01:39


Related issues

Related to Grid Elements - Bug #83778: Files on Flexform imageuploads Accepted 2018-02-05

History

#1 Updated by Gerrit Code Review over 1 year 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/53816

#2 Updated by Claus Due over 1 year ago

Attaching extension to easier reproduce this. Instructions:

  • Manually put the extracted extension into TYPO3
  • Create a new content instance
  • Change the CType to "testce"

Note that the new content wizard does not show this content type, it must be selected with the CType selector when editing the content.

The extension adds a new CType with a FlexForm field with a FAL inline relation field that you can use for the above reproduction steps.

#3 Updated by Susanne Moog 11 months ago

  • Category set to Workspaces

#4 Updated by Jo Hasenau 10 months ago

  • Related to Bug #83778: Files on Flexform imageuploads added

Also available in: Atom PDF