Project

General

Profile

Actions

Bug #89383

closed

Restoring deleted content element in workspace fails

Added by Christian Weiske over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2019-10-09
Due date:
% Done:

100%

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

Description

When trying to restore a deleted content element in a workspace, database gets inconsistent.

Steps to reproduce:

  1. Switch to custom workspace
  2. Create a page
  3. Create a content element on the page
  4. Delete the content element
  5. Open History/Undo for that page
  6. Restore the deleted content element
  7. Look at the page: The element is not visible

In database we have two records:

  • "INITIAL PLACEHOLDER": It has "deleted=0" after restoring
  • "First draft version": It has "deleted=1" after restoring

Before restoring, both had deleted=1.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #21299: Can't restore a deleted page in draft workspaceClosedOliver Hader2009-10-19

Actions
Related to TYPO3 Core - Bug #90679: "Restore record" does not restore recordClosed2020-03-08

Actions
Actions #1

Updated by Christian Weiske over 4 years ago

  • Related to Bug #21299: Can't restore a deleted page in draft workspace added
Actions #2

Updated by Christian Weiske over 4 years ago

A correct undo action would need to set "deleted=0" also on the workspace overlay record ("draft version').

The database inconsisteny causes further problems: When copying a page, previously not visible/existing elements appear on the copied page because copying uses the placeholder data. (Delete element in workspace and restore it - not visible and seemingly lost. Copy & paste the page, and the restored element is surprisingly visible again on the new page)


I'm not sure how to solve this. TYPO3\CMS\Backend\History\RecordHistory::performRollback() does the undo, but does not care about workspaces.
Should this method also take care of rolling back the workspace overlay record?
If not, which place would be better suited?

Actions #3

Updated by Benni Mack over 4 years ago

Thanks for your analysis. I agree that both records should be set to deleted=0.

Christian Weiske wrote:

A correct undo action would need to set "deleted=0" also on the workspace overlay record ("draft version').

The database inconsisteny causes further problems: When copying a page, previously not visible/existing elements appear on the copied page because copying uses the placeholder data. (Delete element in workspace and restore it - not visible and seemingly lost. Copy & paste the page, and the restored element is surprisingly visible again on the new page)


I'm not sure how to solve this. TYPO3\CMS\Backend\History\RecordHistory::performRollback() does the undo, but does not care about workspaces.
Should this method also take care of rolling back the workspace overlay record?
If not, which place would be better suited?

In the end, performRollback calls DataHandler which needs to be handled there (there is a "undelete" command for DataHandler, which seems to not be compatible with workspaces).

Actions #4

Updated by Christian Weiske over 4 years ago

So DataHandler's "undelete" handling needs to be extended to support workspaces.

Actions #5

Updated by Christian Kuhn over 3 years ago

  • Related to Bug #90679: "Restore record" does not restore record added
Actions #6

Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

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/+/67191

Actions #7

Updated by Gerrit Code Review over 3 years 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/+/67191

Actions #8

Updated by Gerrit Code Review over 3 years 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/+/67191

Actions #9

Updated by Gerrit Code Review over 3 years 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/+/67191

Actions #10

Updated by Gerrit Code Review over 3 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/c/Packages/TYPO3.CMS/+/67191

Actions #11

Updated by Christian Kuhn over 3 years ago

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

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF