When cleanup:deletedrecords (or any hard-delete operation) permanently removes a tt_content container record that already has deleted=1, the DeleteHook::processCmdmap_deleteAction also deletes the child records of active, non-deleted sibling translations in the same language.
Steps to reproduce:
- Create a container content element with children (default language, e.g. sys_language_uid=0)
- Create a translation of the container and mark as deleted (deleted=1)
- Create a second translation in the same language (sys_language_uid=1) width children.
- Run vendor/bin/typo3 cleanup:deletedrecords
- Observe that the child elements of the active translation now have deleted=1
Fix:
Before deleting children, check whether another active (non-deleted) translation with the same l18n_parent and sys_language_uid exists. If so, skip the child deletion.
Environment:
- TYPO3: 13.4
- b13/container: 3.2.2