Skip to content

DeleteHook incorrectly deletes child records of active translation when a soft-deleted sibling translation is permanently removed #695

@Friedolin185

Description

@Friedolin185

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:

  1. Create a container content element with children (default language, e.g. sys_language_uid=0)
  2. Create a translation of the container and mark as deleted (deleted=1)
  3. Create a second translation in the same language (sys_language_uid=1) width children.
  4. Run vendor/bin/typo3 cleanup:deletedrecords
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions