Review main Merged

67191[TASK] Make workspace delete a discard

Christian Kuhn CR +2 V +2 Normal +46 −10 updated 12/21/20, 18:27

Commit message

When deleting a record in workspaces that has been
changed in comparison to live - if it is a new, a moved
or a changed workspace record, those records where subject
to the 'soft-delete' strategy of the core: Soft-delete
enabled tables like pages or tt_content did set deleted=1
for those records instead of fully deleting them from the
table. The idea was to allow 'undelete' via recycler or
history module if those records have been deleted by
accident.

However, the undelete workspace records functionality
never worked and has never been fixed. The oldest open
forge issue on this topic is 11 (!) years old.

The solution is to discard those records instead of
soft-deleting them. This effectively drops soft-delete
for workspace records. It's done by a trivial switch in
the main DataHandler delete method to re-route workspace
delete operation to the recently refactored discard
methods instead.

This change allows us to further refactor the remaining
tasks the DataHandler delete functionality is concerned
with, since delete still handles three things:
* Deleting and soft-deleting records in live.
* Creating 'delete placeholder' records in workspaces.
  This is the 'mark the record as to-be-deleted in live
  on workspace publish' operation.
* Undeleting records using recycler and partially the
  history module.

Dropping the workspace-delete scenarios reduces complexity
significantly. The codebase can now be changed with upcoming
patches to separate remaining concerns - similar to what has
been done with discard already. The according scenarios will
see improved test coverage and far better understandable
code along the way. This will ultimately allow us to
fix remaining bugs in this area on one hand and to
improve user experience on the other hand.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 10