Issue Bug Under Review Quiet

#111132Undelete restores inline children deleted before their parent

Benni Mack 10/18/26, 16:04 updated 10/18/26, 16:05

Description

Restoring a record (DataHandler “undelete” command, used by the recycler and by the record history rollback) also restores its inline and file
children. It restores every soft-deleted child that still points to the parent, including children an editor deleted on purpose before the parent was deleted.

Steps to reproduce:

1. Create a content element with an inline relation holding two children A and B (e.g. two file references, or IRRE records with foreign_field).
2. Delete child B and save.
3. Later, delete the content element.
4. Restore the content element in the recycler.

Expected: the content element and child A are restored, B stays deleted.
Actual: B is restored as well and shows up again in the frontend.

This is the still open part of #71245 (closed: cascading restore works since v11, 67ad9d7a720). Content removed on purpose, maybe for legal reasons, comes back without the editor noticing.

Proposed solution: a cascading delete writes all its sys_history entries with the same correlation scope. Restoring a deletion therefore belongs to the record history, not to the DataHandler:

  • RecordHistory::findRecordsDeletedTogetherWith() returns the records
    deleted by the same operation as the latest deletion of a record,
    skipping records deleted before or again after it, and subpages with
    their records.
  • The recycler and the history rollback add these records to the
    command map as explicit “undelete” commands.
  • The DataHandler “undelete” command restores exactly the given record
    and no longer cascades to inline children (breaking, main only).

Reviews 1

History 01