Issue Bug Closed

#97662When removing translated page from the recycler, deletion goes too far and hard delete content elements related to the default language page

Mathieu Bilodeau 05/19/22, 20:57 updated 12/02/25, 14:33

Description

As said in the title, one of our client filled a bug report claiming some content elements were lost while deleting records using the Recycler. We checked the code and found out a way to reproduce this bug with v10.4.27 and v11.5.10.

Here is how to reproduce:

  1. Using a site with multiple languages configured
    1. Default: English
    2. Secondary: French
  2. Create a new page using the default language (ie: English)
  3. Create a text content element in it (or any type of content element)
  4. Create a new translation to this page —> French
  5. Create a new text element for the translation
  6. Test that both languages works fine
  7. Delete the translation, not the content element, to return with only the default language (deleting the french version)
  8. At this point, using the Recycle module, we can see the deleted french translation page
  9. Going back in the Page module, create a new translation of that same page in French again
  10. Add content elements to this new French translation
  11. Using the Recycler module, permanently delete the first (deleted) translation page
  12. When going back to the page module, on the original page, we can witness the latest french content elements are deleted permanently

By tracking every steps of the Recycler, from the delete button to the function TYPO3\CMS\Core\DataHandling\DataHandler\deleteSpecificPage() it became obvious that, when the page deletion occures, the function getDefaultLanguagePageId() will return the value of l10n_parent field and will directly link any tt_content using the uid of the default language page.

Reviews 2

History 1218

  1. Andreas Kießling commented <span data-processor="relativetime" data-value="2022-06-21T16:13:29+00:00" > 06/21/22, 16:13 </span>

    This bug is massive! We also suffered data loss due to this faulty behavior which tracks back to https://github.com/TYPO3/typo3/commit/4f4b1710458437830a4c82c59d641702dd9bc817 which was apparently merged to 9.5 already

  2. Kai Sulkowski commented and changed TYPO3 Version 10 11 PHP Version 7.4 5.3 <span data-processor="relativetime" data-value="2024-02-05T14:06:08+00:00" > 02/05/24, 14:06 </span>

    This bug is really devastating. We emptied our recyclers and a lot of content was irretrievably lost!

  3. Tim Lochmüller commented and changed TYPO3 Version 11 12 PHP Version 5.3 8.2 <span data-processor="relativetime" data-value="2025-01-31T22:00:15+00:00" > 01/31/25, 22:00 </span>

    Run into the same problem today and have to restore many CEs from a DB backup. Very annoying this bug and I think, currently the best solution is either remove recycler extension from the instance or remove pages manually via DB (without the data handler magic).

  4. Andreas Kießling commented <span data-processor="relativetime" data-value="2025-02-05T11:24:57+00:00" > 02/05/25, 11:24 </span>

    Having the recycler installed by default for v13 makes it even worse…

  5. Matthias Kappenberg commented <span data-processor="relativetime" data-value="2025-05-14T06:00:08+00:00" > 05/14/25, 06:00 </span>

    Can this ticket be given high priority please.
    I can reproduce it the current 13.4.10, too.

  6. Andreas Wolf commented and changed status New Accepted TYPO3 Version 12 14 <span data-processor="relativetime" data-value="2025-05-16T08:11:04+00:00" > 05/16/25, 08:11 </span>

    Unfortunately not, I just tried it on latest master including Lollis recent change, and the behaviour is still the same, i.e. the bug is still present.

    The important thing here is that there must be a deleted translation of the page and an active one. The deleted translation of the page is removed together with all (!) content for that translation, also content that is still active and coupled to the active translation of the page. This active translation of the page is also left untouched.

  7. Gerrit Code Review pushed patch set 1 for main to change 89471 status Accepted Under Review <span data-processor="relativetime" data-value="2025-05-20T09:14:19+00:00" > 05/20/25, 09:14 </span>

  8. Christian Kuhn commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-05-20T15:40:07+00:00" > 05/20/25, 15:40 </span>

    Applied in changeset commit:84bffd04033570c0fdeec008a947573db4ed0263.