Project

General

Profile

Actions

Bug #96460

open

Translations are not deleted in workspaces

Added by Hannes Bochmann over 2 years ago. Updated 30 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2022-01-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
translation localization
Complexity:
Is Regression:
Sprint Focus:
Stabilization Sprint

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

bugfix.patch (1.68 KB) bugfix.patch Hannes Bochmann, 2022-01-04 18:45
Screenshot 2024-04-01 alle 19.10.15.png (11.2 KB) Screenshot 2024-04-01 alle 19.10.15.png Riccardo De Contardi, 2024-04-01 17:40
Actions #1

Updated by Jessica Jagodzinski about 2 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:
  1. create for example a textmedia element with an image
  2. translate the element (don't change anything)
  3. change the image in the default language element
  4. 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.

Actions #2

Updated by Benni Mack 11 months ago

  • Sprint Focus set to Stabilization Sprint
Actions #3

Updated by Marcin Sągol 6 months 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?

Actions #4

Updated by Riccardo De Contardi 30 days 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

  1. go to TEST page
  2. switch to DRAFT workspace
  3. Create a CE (e.g. "Header only") on the main language (0)
  4. Translate it to language (1) (Connected mode)
  5. Delete the CE in the main language (0)

Results:

  1. A modal window alerts the user that both the record and its translation will be deleted
  2. the CE is deleted on both languages

Test 2

  1. go to TEST page
  2. switch to DRAFT workspace
  3. Create a CE (e.g. "Text and Images") on the main language (0)
  4. Add to it a reference to an image (e.g. "imageone.jpg") and save it
  5. Translate it to language (1) (Connected mode)
  6. Now the CE is translated and the image is the same on both
  7. 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

  1. in the "Page module" preview, the translated CE has no more a thumbnail for the image
  2. you can edit the translated CE, and there is a reference to the new image, but it is greyed out
  3. 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?

Actions

Also available in: Atom PDF