Bug #96460
openTranslations are not deleted in workspaces
0%
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.
Files
Updated by Jessica Jagodzinski almost 3 years ago
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:- create for example a textmedia element with an image
- translate the element (don't change anything)
- change the image in the default language element
- try to open the translated element
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.
Updated by Marcin Sągol about 1 year ago
@Benni Mack 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?
Updated by Riccardo De Contardi 8 months ago
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?