Bug #88144

TcaGroup does not respect deleted elements in a workspace

Added by Robert Vock 8 months ago. Updated 2 months ago.

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

0%

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

Description

If you delete elements in a workspace, which are used within a group field, those deleted elements still show up in the workspace.

1. To test it, you can generate two sys_file_collections. Add those to one content element of CType uploads.
2. Now change to a workspace and delete one of the sys_file_collections.
3. Go back to editing the content element and see that there are still two file collections.

I've attached a testcase for this problem.

tca-group-test.patch View (5.7 KB) Robert Vock, 2019-04-14 13:40

deleted-in-workspace.png View (34.5 KB) Robert Vock, 2019-04-14 13:41


Related issues

Related to TYPO3 Core - Bug #88046: RelationHandler does not respect deleted elements Needs Feedback 2019-04-01

History

#1 Updated by Robert Vock 8 months ago

I think the correct solution would be to remove the deletePlaceholders after getting the items from DB:
TcaGroup.php:86

$relationHandler->getFromDB();
$relationHandler->processDeletePlaceholder(); // <-- NEW
$relations = $relationHandler->getResolvedItemArray();

But it also appears that the RelationHandler does not correctly purges delete placeholders:
RelationHandler.php:1565

$queryBuilder->expr()->neq(
    't3ver_wsid',
    $queryBuilder->createNamedParameter(
        $this->getWorkspaceId(),
        \PDO::PARAM_INT
    )
),

It removes all elements which are deleted in OTHER workspaces, not in the current. If I am correct, the neq should be a eq.

#2 Updated by Gerrit Code Review 8 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/+/60468

#3 Updated by Gerrit Code Review 8 months 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/+/60468

#4 Updated by Gerrit Code Review 8 months 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/+/60468

#5 Updated by Benni Mack 2 months ago

  • Related to Bug #88046: RelationHandler does not respect deleted elements added

#6 Updated by Gerrit Code Review 2 months 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/+/60468

#7 Updated by Gerrit Code Review 2 months 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/+/60468

#8 Updated by Gerrit Code Review 2 months 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/+/60468

#9 Updated by Gerrit Code Review 2 months ago

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

Also available in: Atom PDF