Review main Merged

89497[BUGFIX] Improve recycler hard delete DB consistency

Christian Kuhn CR +2 V +2 Hard +255 −83 updated 05/26/25, 10:18

Commit message

This change looks at some details in DataHandler when records are
hard-deleted - when (typically already soft-deleted) records
are removed from DB using the recycler.

These scenarios are fixed:

* When records having "true" MM relations are soft-deleted, the
  relations are kept in the MM table. This is done to allow "undelete"
  of such records and getting the MM relations "back" as well.
  However, when hard-deleting a local or foreign side record, the
  connected MM rows need to be removed. The patch takes care and
  supports the fix with tests.
* When hard-deleting default language pages, existing localized page
  versions of that page must be removed as well. This is important to
  retain DB consistency since otherwise the localized pages are left
  orphaned. The patch takes care and adds tests.
* Similar to the above scenario, any existing sub page DB rows must be
  removed (along with records on them) when a parent page is hard
  deleted, otherwise the rootline of sub pages is broken. Fix and add
  tests.

The patch refactors a detail in DataHandler to achieve this: DataHandler
has a fishy "disableDeleteClause" toggle to make it fetch soft-deleted
records as well. This is only used within the recycler, which
additionally uses the $forceHardDelete toggle on deleteAction().
disableDeleteClause is used very inconsistently within DataHandler - it
should usually only belong to the 'delete' code path, but is also use
elsewhere. This makes everything more complicated than it should be.
Together with the fact that $forceHardDelete already tells DataHandler
to ignore soft-delete, "disableDeleteClause" is more of a burden than
help. Since that toggle is only actively used by ext:recycler and
probably does more harm than good when used in different code paths than
"delete", it is fully removed now. Note the v13 backport of the patch
keeps disableDeleteClause() as no-op method.

Note these forced hard-delete recycler scenarios are similar to
delete scenarios when tables are not soft-delete aware which has a
couple of issues as well. This is covered by #79014 which could have
a more detailed look as well, after lots of the delete code path has
been streamlined and disentangled with #106631.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 5

Files 12

Review log 2850

Show 1325 earlier messages
  1. Christian Kuhn uploaded patch set 1 05/21/25, 11:29

  2. core-ci voted on patch set 1 V -1 05/21/25, 11:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79295

  3. Christian Kuhn uploaded patch set 2 V -1 05/21/25, 11:42

  4. core-ci voted on patch set 2 V +1 05/21/25, 11:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79296

  5. Christian Kuhn uploaded patch set 3 V +1 05/21/25, 11:54

  6. Christian Kuhn uploaded patch set 4 05/21/25, 11:58

  7. core-ci voted on patch set 3 V -1 05/21/25, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79297

  8. core-ci voted on patch set 4 V +1 05/21/25, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79299

  9. Christian Kuhn uploaded patch set 5 V +1 05/21/25, 12:20

  10. core-ci voted on patch set 5 V +1 05/21/25, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79301

  11. Christian Kuhn uploaded patch set 6 V +1 05/21/25, 13:47

  12. core-ci voted on patch set 6 V -1 05/21/25, 13:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79308

  13. Christian Kuhn uploaded patch set 7 V -1 05/21/25, 14:06

  14. core-ci voted on patch set 7 V +1 05/21/25, 14:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79309

  15. Christian Kuhn uploaded patch set 8 V +1 05/21/25, 14:25

  16. core-ci voted on patch set 8 V +1 05/21/25, 14:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79310

  17. Christian Kuhn uploaded patch set 9 V +1 05/21/25, 14:38

  18. Christian Kuhn uploaded patch set 10 05/21/25, 14:40

  19. Christian Kuhn updated the commit message in patch set 11 05/21/25, 14:43

  20. core-ci voted on patch set 9 V +1 05/21/25, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79314

  21. core-ci voted on patch set 10 V +1 05/21/25, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79315

  22. core-ci voted on patch set 11 V +1 05/21/25, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79316

  23. Christian Kuhn uploaded patch set 12 V +1 05/21/25, 15:39

  24. core-ci voted on patch set 12 V +1 05/21/25, 15:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79322

  25. Christian Kuhn uploaded patch set 13 V +1 05/22/25, 09:54

  1. Christian Kuhn updated the commit message in patch set 14 05/22/25, 09:54

  2. Christian Kuhn uploaded patch set 15 05/22/25, 09:54

  3. core-ci voted on patch set 13 V -1 05/22/25, 10:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79357

  4. core-ci voted on patch set 14 V -1 05/22/25, 10:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79358

  5. core-ci voted on patch set 15 V +1 05/22/25, 10:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79359

  6. Christian Kuhn updated the commit message in patch set 16 V +1 05/22/25, 13:35

  7. Christian Kuhn commented on patch set 16 05/22/25, 13:35

  8. core-ci voted on patch set 16 V +1 05/22/25, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79372

  9. Christian Kuhn uploaded patch set 17 V +1 05/22/25, 14:30

  10. Christian Kuhn uploaded patch set 18 05/22/25, 14:37

  11. core-ci voted on patch set 17 V -1 05/22/25, 14:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79380

  12. core-ci voted on patch set 18 V +1 05/22/25, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79381

  13. Christian Kuhn uploaded patch set 19 V +1 05/22/25, 15:23

  14. Christian Kuhn updated the commit message in patch set 20 05/22/25, 15:27

  15. Christian Kuhn updated the commit message in patch set 21 05/22/25, 15:30

  16. core-ci voted on patch set 19 V +1 05/22/25, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79382

  17. core-ci voted on patch set 20 V +1 05/22/25, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79383

  18. Benni Mack updated the commit message in patch set 22 05/22/25, 15:36

  19. core-ci voted on patch set 21 V +1 05/22/25, 15:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79384

  20. core-ci voted on patch set 22 V +1 05/22/25, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79385

  21. Stefan Bürk voted on patch set 22 CR +1 V +1 05/22/25, 16:55

  22. Georg Ringer voted on patch set 22 CR +1 V +1 05/25/25, 18:46

  23. Benni Mack voted on patch set 22 CR +1 V +1 05/25/25, 19:51

  24. Christian Kuhn voted on patch set 22 CR +2 V +2 05/26/25, 10:17

  25. Christian Kuhn merged patch set 23 05/26/25, 10:18