Skip to content

"Unused elements detected" when translating page with "Connected mode" #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andihuber opened this issue Apr 3, 2025 · 3 comments
Open

Comments

@andihuber
Copy link

Typo3 v13.4.5
Container: 3.1.6

When i translate page content in "Connected mode" (German -> English) then i get unused elements in the new language.

For example i have:
Container Element -> 2 Columns -> inside for example Text and Header

Image

The Text and Header elements then are listed in the footer of the page as "unused elements" AND they are in the container itself

Some more facts:

  • In frontend i can see the content in both languages in the correct column and in the correct container element.
  • I can see the "unused element" in the second language in backend twice. It is in the 2 column element, additionally at the bottom as unused.
  • When i delete the "unused element" in backend in second language (English) then it also is not visible any longer on frontend.

This issue just occurs when translating in "Connected mode". When i use "Copy mode" for translation everything is fine.

Please heeelp :-)

@achimfritz
Copy link
Contributor

i @andihuber , i cannot reproduce, maybe any site-effects with other extensions, or wrong configurations?

this behaviour here is my DB

default language

MariaDB [db]> select uid,sorting,CType,header,colPos,tx_container_parent from tt_content where sys_language_uid=0 order by sorting;
+-----+---------+---------------------------------+-------------+--------+---------------------+
| uid | sorting | CType                           | header      | colPos | tx_container_parent |
+-----+---------+---------------------------------+-------------+--------+---------------------+
|   1 |     192 | b13-2cols-with-header-container | container   |      0 |                   0 |
|  18 |     608 | header                          | child left  |    201 |                   1 |
|   2 |     864 | header                          | child right |    202 |                   1 |
+-----+---------+---------------------------------+-------------+--------+---------------------+

translate

MariaDB [db]> select uid,sorting,CType,header,colPos,tx_container_parent from tt_content where sys_language_uid>0 order by sorting;
+-----+---------+---------------------------------+-------------+--------+---------------------+
| uid | sorting | CType                           | header      | colPos | tx_container_parent |
+-----+---------+---------------------------------+-------------+--------+---------------------+
|  20 |     736 | header                          | child left  |    201 |                   1 |
|  21 |     800 | header                          | child right |    202 |                   1 |
|  19 |    1120 | b13-2cols-with-header-container | container   |      0 |                   0 |
+-----+---------+---------------------------------+-------------+--------+---------------------+

(btw. sorting of translation is wrong here, this will fixed with #610
you will get

MariaDB [db]> select uid,sorting,CType,header,colPos,tx_container_parent from tt_content where sys_language_uid>0 order by sorting;
+-----+---------+---------------------------------+-------------+--------+---------------------+
| uid | sorting | CType                           | header      | colPos | tx_container_parent |
+-----+---------+---------------------------------+-------------+--------+---------------------+
|  22 |     400 | b13-2cols-with-header-container | container   |      0 |                   0 |
|  23 |     736 | header                          | child left  |    201 |                   1 |
|  24 |     800 | header                          | child right |    202 |                   1 |
+-----+---------+---------------------------------+-------------+--------+---------------------+

@niederberger-qw
Copy link

We have the same problem here... Translation English (0) to German (1) in Connected Mode

@withAdaam
Copy link

withAdaam commented Apr 19, 2025

I’m experiencing the same issue on my end. What I’ve noticed is that it only occurs when containers are nested. From the screenshot, it looks like the author is also nesting containers.

I believe the issue lies in the database: specifically, with the tx_container_parent ID of the content elements when containers are nested.

In my database, when I use the connected translation function, it creates a copy of the container and its inner elements in the tt_content table. However, the inner elements still reference the original container in the tx_container_parent field, instead of the translated one. This seems to be intended, it doesn't make any problems and displays the content in the right way without the "unused content"-issue.

Interestingly, the elements of the nested container do get linked to the translated container and it seems to me that this creates the issue.

As a temporary fix, if I manually change the tx_container_parent value of the affected content elements to the ID of the nested container from the original language, the issue is resolved and the content displays correctly on the translated page and in the backend.

I’ve also observed that this problem seems to occur only when translating the entire page at once. If I break the process into two steps — first translating the top-level containers (including their nested containers), and then translating the inner content elements — the issue does not appear.

I try to make this more clear:

Original Language:

+-----+---------------------------------+-------------------------+-----------------------------+
| uid  | CType                                         | tx_container_parent     |     personal note
+-----+---------------------------------+-------------------------+-----------------------------+
|  6    | b13-con                                     |                        0  |  Level 1 Container
|  7    | b13-con                                     |                        6  |  Nested Container
|  9    | header                                       |                        7  |  Content Element
+-----+---------+---------------------------------+-------------+--------+---------------------+

Translated Language:

+-----+---------------------------------+-------------------------+-----------------------------+
| uid  | CType                                         | tx_container_parent     |     personal note
+-----+---------------------------------+-------------------------+-----------------------------+
|  55    | b13-con                                     |                           0  |  Level 1 Container
|  56    | b13-con                                     |                           6  |  Nested Container
|  57    | header                                       |                         56  |  Content Element !!PROBLEM
+-----+---------+---------------------------------+-------------+--------+---------------------+

Translated Language hotfix:

+-----+---------------------------------+-------------------------+-----------------------------+
| uid  | CType                                         | tx_container_parent     |     personal note
+-----+---------------------------------+-------------------------+-----------------------------+
|  55    | b13-con                                     |                          0  |  Level 1 Container
|  56    | b13-con                                     |                          6  |  Nested Container
|  57    | header                                       |                          7  |  Content Element !!Solution
+-----+---------+---------------------------------+-------------+--------+---------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants