Review main Merged

89471[BUGFIX] Recycler may hard-delete too much

Christian Kuhn CR +2 V +2 Normal +144 −58 updated 05/20/25, 15:37

Commit message

Localized records are not attached to a localized page
directly: They only "know" the default language page record
since their pid is set to it.

This can lead to broken behavior in this scenario:
* Have a page with a page localization and some localized
  content elements.
* Soft-delete the page localization. This will soft-delete
  localized content elements as well. Good.
* Create a new page localization in the same language and
  add some localized content elements. We now have two
  localized pages for the same language in DB: One "active",
  the other one soft-deleted.
* Use the recycler to hard-delete the previously soft-deleted
  page localization. This hard-deletes all localized content
  elements. Bad.

Since there is no information which page localization a
content element (or more generally any record) belongs to,
the fix is to check during hard-delete of localized pages if
another page localization in this language exists and to
skip record deletion in this case.

Review

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

Issues 1

Files 5

Review log 1216

  1. Christian Kuhn uploaded patch set 1 05/20/25, 09:14

  2. Christian Kuhn rebased onto patch set 2 05/20/25, 10:19

  3. core-ci voted on patch set 2 V -1 05/20/25, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79227

  4. Christian Kuhn uploaded patch set 3 V -1 05/20/25, 11:03

  5. core-ci voted on patch set 3 V +1 05/20/25, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79231

  6. Christian Kuhn uploaded patch set 4 V +1 05/20/25, 11:45

  7. core-ci voted on patch set 4 V +1 05/20/25, 11:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79235

  8. Stefan Bürk commented on patch set 4 05/20/25, 12:35

    Reviewing ...
  9. Stefan Bürk commented on patch set 4 05/20/25, 13:02

    DataHandler.php:5473

    ```suggestion // Restriction when hard deleting localized pages: Usually, localized records are hard deleted as well ```
  10. Christian Kuhn commented on patch set 4 05/20/25, 13:14

    DataHandler.php:5473 Reply

    Done
  11. Christian Kuhn uploaded patch set 5 V +1 05/20/25, 13:14

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

  13. Stefan Bürk commented on patch set 5 CR +1 V +1 05/20/25, 13:51

    Reply

    Done
  14. Benni Mack voted on patch set 5 CR +1 V +1 05/20/25, 15:21

  15. Christian Kuhn voted on patch set 5 CR +2 V +2 05/20/25, 15:37

  16. Christian Kuhn merged patch set 6 05/20/25, 15:37