Project

General

Profile

Actions

Bug #82221

open

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

Added by Claus Due over 6 years ago. Updated over 2 years ago.

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

0%

Estimated time:
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.


Files

Actions #1

Updated by Gerrit Code Review over 6 years 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

Actions #2

Updated by Claus Due over 6 years 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.

Actions #3

Updated by Susanne Moog over 6 years ago

  • Category set to Workspaces
Actions #5

Updated by Susanne Moog about 5 years ago

  • Status changed from Under Review to New

Patch has been abandoned.

Actions #6

Updated by Christian Weiske almost 5 years ago

As far as I understood the code, the problem is that for non-flexform inline references, DataHandler::remapListedDBRecords() calls remapListedDBRecords_procInline().

For inline references inside flexforms, DataHandler::remapListedDBRecords() calls remapListedDBRecords_flexFormCallBack() which only handles references (type=group||select), but not type=inline. Making the flexFormCallBack handle inline references as well should solve the issue(TM).


Also note that there is an extension that fixes this bug: https://github.com/NamelessCoder/inline_fal_fix

Actions #8

Updated by Christian Weiske almost 5 years ago

Screenshot of database data problem in sys_file_reference that occurs without the patch.

Actions #9

Updated by Gerrit Code Review almost 5 years 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/+/61085

Actions #10

Updated by Gerrit Code Review almost 5 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/c/Packages/TYPO3.CMS/+/61085

Actions #11

Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/61085

Actions #12

Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/61085

Actions #13

Updated by Gerrit Code Review almost 4 years ago

Patch set 5 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/+/61085

Actions #14

Updated by Gerrit Code Review over 3 years ago

Patch set 6 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/+/61085

Actions #15

Updated by Christian Kuhn over 2 years ago

  • Status changed from Under Review to New
Actions

Also available in: Atom PDF