Bug #73761
closedMoving or deleting in flexform section lists not possible when using workspaces and creating first version
100%
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.
Updated by Tina Westner almost 3 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
Updated by Gerrit Code Review over 2 years 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
Updated by Gerrit Code Review over 2 years 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
Updated by Gerrit Code Review over 2 years 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
Updated by Christian Kuhn over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 53e96c4cd2f9c0c043d4ac3f24b778bae89946c8.
Updated by Gerrit Code Review over 2 years 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
Updated by Gerrit Code Review over 2 years 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
Updated by Gerrit Code Review over 2 years 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
Updated by Gerrit Code Review over 2 years 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
Updated by Christian Kuhn over 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset d209764eca7dc8a6c8a0cf12a78fcab61e068259.
Updated by Gerrit Code Review over 2 years 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
Updated by Christian Kuhn over 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset 03bc23b995ff5d7838c1e2081a6217609397c5bb.