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 #1

Updated by Oliver Hader over 11 years ago

  • Status changed from New to Accepted

Possibility would be either
a) to fetch only records for the accordant mass action that can be published (thus "not deleted")
b) catch during action publishing process in DataHandler/DataHandlerHook, whether record does exist and thus can be published at all

"a" does not seem to work, if the page got removed as a result of the publishing process.

Actions #2

Updated by Gerrit Code Review over 11 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #3

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #4

Updated by Gerrit Code Review about 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #5

Updated by Gerrit Code Review about 11 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #6

Updated by Gerrit Code Review about 11 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #7

Updated by Gerrit Code Review about 11 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #8

Updated by Michael Stucki almost 11 years ago

  • Category set to Workspaces
Actions #9

Updated by Michael Stucki almost 11 years ago

  • Project changed from 624 to TYPO3 Core
  • Category changed from Workspaces to Workspaces
Actions #10

Updated by Gerrit Code Review over 10 years 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/23129

Actions #11

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23129

Actions #12

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.5
Actions #13

Updated by Oliver Hader about 9 years ago

  • Target version changed from 7.5 to 7 LTS
  • Complexity set to medium
  • Is Regression set to No
Actions #14

Updated by Gerrit Code Review about 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23129

Actions #15

Updated by Gerrit Code Review over 8 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #16

Updated by Jan Helke about 8 years ago

  • Sprint Focus set to On Location Sprint
Actions #17

Updated by Gerrit Code Review almost 8 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #18

Updated by Gerrit Code Review almost 8 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #19

Updated by Gerrit Code Review almost 8 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23129

Actions #20

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50877

Actions #21

Updated by Oliver Hader almost 8 years ago

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

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF