#96460Translations are not deleted in workspaces
Description
When an element (e.g. tt_content) is created/edited in a workspace and this element has a translation, the translation won’t be deleted when the original element is deleted in the workspace. Outside of workspaces this works as expected. In TYPO3 8.7 this worked in workspaces as well.
Please find a patch attached which fixes the problem in TYPO3 10.4. I would provide a pull request but I’m not sure if my solution is correct but it feels more like a workaround/hack.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 2
History 5
-
Jessica Jagodzinski commented <span data-processor="relativetime" data-value="2022-02-08T09:50:01+00:00" > 02/08/22, 09:50 </span>
-
Benni Mack changed Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2023-06-06T13:00:33+00:00" > 06/06/23, 13:00 </span>
-
Marcin Sągol commented <span data-processor="relativetime" data-value="2023-10-31T10:13:25+00:00" > 10/31/23, 10:13 </span>
@benni i have tested this issue on current main branch and also TYPO3 v11, since from this version there were changes in DataHandler code, related to reported problem.
- I have created new content element in the custom Drafts workspace
- I have translated this content element to second language
- I have deleted the record in default language
- Both records in tt_content table were removed, so i couldn’t reproduced this issue on TYPO3 v11+Since TYPO3 v11, DataHanlder calls the deleteRecord() function and than internally discard() function which takes care of the required removal of records.
Here the records from this workspace are permanently removed, no soft delete is used, so they are gone from DB.Should we close this issue than, since its fixed from version 11?
-
Riccardo De Contardi commented and changed attached Screenshot 2024-04-01 alle 19.10.15.png <span data-processor="relativetime" data-value="2024-04-01T17:41:14+00:00" > 04/01/24, 17:41 </span>
I have performed the following tests with TYPO3 11, 12 and 13.1.0-dev (latest main):
Prerequisites
- fresh TYPO3 installation with a DRAFT workspace and two languages (0 and 1)
- a TEST page created in LIVE workspace, translated (present on both languages 0 and 1)
Test 1
- go to TEST page
- switch to DRAFT workspace
- Create a CE (e.g. “Header only”) on the main language (0)
- Translate it to language (1) (Connected mode)
- Delete the CE in the main language (0)
Results:
- A modal window alerts the user that both the record and its translation will be deleted
- the CE is deleted on both languages
Test 2
- go to TEST page
- switch to DRAFT workspace
- Create a CE (e.g. “Text and Images”) on the main language (0)
- Add to it a reference to an image (e.g. “imageone.jpg”) and save it
- Translate it to language (1) (Connected mode)
- Now the CE is translated and the image is the same on both
- Edit the CE in the main language (1), delete the reference to the image “imageone.jpg” and add a reference to another image e.g. “imagetwo.jpg”, save it
Results
- in the “Page module” preview, the translated CE has no more a thumbnail for the image
- you can edit the translated CE, and there is a reference to the new image, but it is greyed out
- there is a “mystery icon” on the right (see attached screenshot), when you hover it the title is “Localize”; clicking on it, it truly “connects” the image, so that now it is fully present as a thumbnail also on the “Page module” preview.
Is this the expected behavior? should a different test be performed?
-
Christian Kuhn commented and changed status
NewClosed <span data-processor="relativetime" data-value="2025-02-03T06:32:35+00:00" > 02/03/25, 06:32 </span>I agree. Both Marcin and Riccardo describe this issue in resolved since v11, IIRC this was one of the goals of the discard works in v11. I hope it is ok to close here.
This behavior also means that translations can no longer be opened if a sys_file_reference is deleted in the default data record.
How to test it:You’ll get following error:
Default language record with id 3486 not found in table sys_file_reference while editing record 3489
The patch fixes the problem that the translated element cannot be opened. However, the behavior in the workspace is not identical to that in the live system.
If you delete an image and immediately add a new one, the old image will be deleted from the translation, but the new one will not be created. The relation to the default sys_file_reference element is lost.