Project

General

Profile

Actions

Bug #47384

closed

Error when deleting a record and the page its on

Added by Lienhart Woitok over 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
Start date:
2013-04-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

When someone deletes a record on a page in workspace (e.g. a content element on a page) and then deletes the page itself, then during a mass action "publish" an error message is shown: "Error: You cannot swap versions for a record you do not have access to edit!". The page and all records on it (including the one explicitly deleted) are deleted despite the message.

Steps to reproduce:

  1. As an editor go into workspace
  2. Delete a content element on a page
  3. Delete the page itself (you may need to delete the page twice until the delete marker is shown, but there is another bug for this already)
  4. Go into workspace module and start a mass action "publish"

Expected behavior:

The page and all records on it are deleted without error message

Actual behavior:

The page and all records on it are deleted but an error message is shown

Some more background about what happens:

  1. The mass action handler collects all records in workspace in TCA order (which puts pages first)
  2. The collected records are then processed in the order they have been collected
    1. The page gets deleted. When deleting a page, all records on the page are deleted, too.
    2. The content element is tried to get deleted. But it has already been deleted as all records on the page have been deleted. Therefore it cannot be deleted again.
I'm willing to fix this bug, but I'm lacking an idea how to do it. There are mainly two ways I could imagine:
  1. Keep track of all records that are deleted during workspace publish and remove them from the session variable "workspaceMassAction" and tceMain->cmd_map. This would need some kind of hook in t3lib_tcemain::deleteRecord which currently doesn't exist.
  2. Somehow resolve dependencies when collecting the records to process. This could ensure that records are deleted before pages are deleted. We would probably have to make sure that pages are created before records are created, so just ordering the tables is not sufficient. Problem here is that the information retrieved when collecting the workspace records is not sufficient to determine whether a record is deleted or not.

Both solutions seem to be way too complex for simply suppressing a false error message, but I don't see a simple solution.

Do you have any suggestion how I should proceed with this?

Actions

Also available in: Atom PDF