Project

General

Profile

Actions

Bug #73761

closed

Moving or deleting in flexform section lists not possible when using workspaces and creating first version

Added by Klaus Moser about 8 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2016-02-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

There is an issue when using workspaces and section lists in flexforms. This bug appeared in combination with templavoila but as far as i understand the code, this can happen to all flexform fields. This bug will appear when trying to versionize a content element the first time that contains a flexform section list.

Steps to reproduce:

In live workspace add a new content element to a page that contains a flexform section list and add two section items minimum. Switch to a custom workspace and change the ordering of the section items (deleting of section items also doesn't work). Save it and open it again. Sections items were not moved or deleted. Do this again and it works.

Took me 16 hours of debugging to find the code passage that causes this bug. In TYPO3\CMS\Core\DataHandling\DataHandler->checkValue_flex() line 2308 a post array is read.

// Action commands (sorting order and removals of elements)
$actionCMDs = GeneralUtility::_GP('_ACTION_FLEX_FORMdata');
if (is_array($actionCMDs[$table][$id][$field]['data'])) {
...

This post array contains for example

$actionCMDs[tt_content][1234][tx_myext_myflex][data][sDEF][lDEF][some_section][el][_ACTION][...]

If there is no versionized record for this record yet, the uid 1234 is the uid of the original record. But this is wrong because according to the code in checkValue_flex this has to be the id of the versionized record, which doesn't exist yet. Therefore the condition

if (is_array($actionCMDs[$table][$id][$field]['data'])) {

will not get true. So no deletion or moving will happen.

If the record is versionized already the uid in the post array is correct and moving and deleting works fine.

Actions #1

Updated by Tina Westner about 2 years ago

  • TYPO3 Version changed from 6.2 to 10

I can confirm, that this issue still exists in 10.4.23

The mentioned code now lays in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValueForFlex, lines 2291ff

Actions #2

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

Actions #3

Updated by Gerrit Code Review over 1 year ago

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

Actions #4

Updated by Gerrit Code Review over 1 year ago

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

Actions #5

Updated by Christian Kuhn over 1 year ago

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

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

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

Actions #7

Updated by Gerrit Code Review over 1 year ago

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

Actions #8

Updated by Gerrit Code Review over 1 year ago

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

Actions #9

Updated by Gerrit Code Review over 1 year ago

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

Actions #10

Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

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

Actions #12

Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF