Bug #75400

Related child elements don't get correct sys_language_uid during localization of parent record

Added by Jan-Michael Loew over 3 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Localization
Start date:
2016-04-04
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

When trying to copy Content Elements with inline relations (e.g. Image Elements, also happens with Gridelements), the inline relations are not translated.

Bildschirmfoto 2016-04-25 um 17.53.03.png View (51.1 KB) Birger Stöckelmann, 2016-04-25 18:02


Related issues

Related to TYPO3 Core - Bug #63092: Inline/IRRE records: language field of child records is not updated when modifying parent language field - e.g. problematic for sys_file_reference Rejected 2014-11-20
Related to TYPO3 Core - Bug #68040: Inline localize and/or synchronize does not respect sorting Under Review 2018-03-14 2018-03-14
Related to Grid Elements (former official tracker) - now moved to Gitlab! - Bug #77756: Translated elements are not moved within grid container, when language parent is moved - Regression? Resolved 2016-09-01
Related to Grid Elements (former official tracker) - now moved to Gitlab! - Bug #77067: Copying or moving Grid Elements to empty columns of other languages doesn't work Resolved 2016-07-12
Related to TYPO3 Core - Bug #78599: Copy localized content element leads to wrong reference, translation fails Closed 2016-11-07
Duplicated by Grid Elements (former official tracker) - now moved to Gitlab! - Bug #76171: Localization: Translate & Copy problem with 3+ languages in 7.6 Rejected 2016-05-12

Associated revisions

Revision c9d79db5 (diff)
Added by Tymoteusz Motylewski over 2 years ago

[BUGFIX] Make copy mode of translation modal use localize

... omitting TransOrigPointer

While translating elements with the localization modal we have to
make sure that the "Copy" mode does more than just a plain copy
followed by an update of the sys_language_uid. Otherwise related
elements will just be copied along but don't get a new language.

This patch replaces the copy action with a new action called
copyToLanguage. It behaves like localize action but does not set
TransOrigPointer fields, so child elements get the correct
language and are not connected to a language parent.

Resolves: #75400
Releases: master, 7.6
Change-Id: If57af3c94c67824ab8bbbc62a8c6bea283e96fca
Reviewed-on: https://review.typo3.org/47645
Tested-by: TYPO3com <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 7a7b7e10 (diff)
Added by Tymoteusz Motylewski over 2 years ago

[BUGFIX] Make copy mode of translation modal use localize

... omitting TransOrigPointer

While translating elements with the localization modal we have to
make sure that the "Copy" mode does more than just a plain copy
followed by an update of the sys_language_uid. Otherwise related
elements will just be copied along but don't get a new language.

This patch replaces the copy action with a new action called
copyToLanguage. It behaves like localize action but does not set
TransOrigPointer fields, so child elements get the correct
language and are not connected to a language parent.

Resolves: #75400
Releases: master, 7.6
Change-Id: If57af3c94c67824ab8bbbc62a8c6bea283e96fca
Reviewed-on: https://review.typo3.org/51109
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>

History

#1 Updated by Mathias Brodala over 3 years ago

Notice that this refers to the "Copy" mode for content translation. Thus basically the content element is copied with the target language set, but none of its "children" is.

#2 Updated by Jo Hasenau over 3 years ago

  • Subject changed from Inline Relations not translated on copy of Content Element to Related child elements don't get correct sys_language_uid during localization of parent record
  • Category set to Localization
  • Priority changed from Should have to Must have
  • Target version set to 7.6.3

#3 Updated by Mathias Brodala over 3 years ago

  • Target version changed from 7.6.3 to next-patchlevel

#4 Updated by Jo Hasenau over 3 years ago

  • Target version changed from next-patchlevel to 7.6.3

Basically the copy mode triggers a simple copy action for that parent element and just adds the sys_language_uid within the update array.
So while the copy action nicely cascades and copies all the related children and grandchildren, the language information will just be applied to the first level.

#5 Updated by Mathias Brodala over 3 years ago

Why target TYPO3 7.6.3? That version was already released (currently 7.6.5), thus next-patchlevel is the only option here.

#6 Updated by Jo Hasenau over 3 years ago

  • Status changed from New to Accepted

Just didn't notice - but of course next patchlevel is correct.

#7 Updated by Mathias Brodala over 3 years ago

  • Target version changed from 7.6.3 to next-patchlevel

Alright. :-)

#8 Updated by Jo Hasenau over 3 years ago

  • Assignee set to Jo Hasenau
  • Target version changed from next-patchlevel to 7.6.3

Currently we are working as a team at T3UXW16 on several translation/localization issues and we think we found a solution for this bug.

Actually there already is a method that does everything correctly and finds all related children, and actually we already use it when the user clicks on "Translate".
In this case the core will use the localize methods, which will nicely cascade through the relation chains and set everything correctly which would be still correct for the "Copy" mode, except one field.
The only difference between "Translated" and "Copied" elements is the fact, that a copy does not get an l10n_parent.

So our solution would be: We will introduce an optional parameter for the localization methods that will enable us to ignore the l10n_parent during that process.
We can stll use the same modal, the same AJAX calls and the same value arrays, but we will use localize in both cases, with the second case making use of the new parameter.

#9 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#10 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#11 Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#12 Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#13 Updated by Birger Stöckelmann over 3 years ago

This patch is working for me (works with gridelements and their children as well) but there is still a small caveat, because elements are copied into a wrong position.

Steps to reproduce:

1. Add content elements to the page in default language
2. Translate in copy mode
3. Add another content element in default language
4. Translate again with copy

After step 4 you will see the newly copied content element in a wrong position. (TYPO3 7.6.5, patched with this patch only).

#14 Updated by Jo Hasenau about 3 years ago

Could you please test, if the changed order happens also with the "translation" mode of the modal?
The patch makes use of the same methods but does not set the transOrigPointerField, so actually sorting should be the same.
If this is the case, we should file another issue for that problem.

#15 Updated by Gerrit Code Review about 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#16 Updated by Ralph Brugger about 3 years ago

We've had the same problem.
With gridelements, CEs that are inside a gridelement won't be translated.
They appear in the FE but noch in the BE.
We've tried patch set 5 within TYPO3 7.6.9 and now it seems to work.

#17 Updated by Benni Mack about 3 years ago

  • Target version changed from 7.6.3 to Candidate for patchlevel

#18 Updated by Pascal Dürsteler about 3 years ago

Tried patchset 5 with 7.6.9 but could not verify this; A few elements are not copied at all or copied empty..

#19 Updated by Gerrit Code Review about 3 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#20 Updated by Gerrit Code Review about 3 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#21 Updated by Gerrit Code Review about 3 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#22 Updated by Gerrit Code Review about 3 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#23 Updated by Gerrit Code Review about 3 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#24 Updated by Gerrit Code Review about 3 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#25 Updated by Gerrit Code Review almost 3 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#26 Updated by Gerrit Code Review almost 3 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#27 Updated by Gerrit Code Review almost 3 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#28 Updated by Ralph Brugger almost 3 years ago

I've just putted some code comments to the patch set 11.
Tested this again with patch 14:

Parse error: syntax error, unexpected ':', expecting ';' or '{' in ../typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 2616

    protected function getUniqueCountStatement(
        string $value,
        string $table,
        string $field,
        int $uid,
        int $pid
    ): Statement {

=> ": Statement " Does not work with PHP 5.6

Parse error: syntax error, unexpected '.' in /typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 3533

$queryBuilder
   ->select(...$fields)

=> "...$fields" Does not work with PHP 5.6

Parse error: syntax error, unexpected '.' in /typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 4955

$result = $queryBuilder
    ->select(...$fileFieldArr)

=> "...$fileFieldArr" Does not work with PHP 5.6

Parse error: syntax error, unexpected '.' in /data/www/sites/bst-update/shared/typo3_src/typo3_src-7.6.10/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 6606

$result = $queryBuilder
  ->select(...GeneralUtility::trimExplode(',', $fieldList))

=> "...GeneralUtility" Does not work with PHP 5.6

same in:
Parse error: syntax error, unexpected '.' in /typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 7107

PHP Version in this ticket ist set to 5.6.

#29 Updated by Stefan Neufeind almost 3 years ago

For master (8.x) we have PHP 7.0+. So that wouldn't be a problem and I'd appreciate to make use of improved syntax-possibilities there.
For 7.6 we'll need to adapt the code - but that's doable then.

#30 Updated by Gerrit Code Review almost 3 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#31 Updated by Gerrit Code Review almost 3 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#32 Updated by Gerrit Code Review almost 3 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#33 Updated by Gerrit Code Review almost 3 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#34 Updated by Gerrit Code Review almost 3 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#35 Updated by Gerrit Code Review almost 3 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#36 Updated by Gerrit Code Review almost 3 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#37 Updated by Gerrit Code Review almost 3 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#38 Updated by Gerrit Code Review almost 3 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#39 Updated by Gerrit Code Review almost 3 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#40 Updated by Gerrit Code Review almost 3 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#41 Updated by Gerrit Code Review almost 3 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#42 Updated by Gerrit Code Review almost 3 years ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#43 Updated by Gerrit Code Review almost 3 years ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#44 Updated by Gerrit Code Review almost 3 years ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#45 Updated by Gerrit Code Review almost 3 years ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#46 Updated by Gerrit Code Review over 2 years ago

Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#47 Updated by Anja Leichsenring over 2 years ago

  • Sprint Focus set to On Location Sprint

#48 Updated by Gerrit Code Review over 2 years ago

Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#49 Updated by Gerrit Code Review over 2 years ago

Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#50 Updated by Gerrit Code Review over 2 years ago

Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#51 Updated by Gerrit Code Review over 2 years ago

Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#52 Updated by Gerrit Code Review over 2 years ago

Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47645

#53 Updated by Tymoteusz Motylewski over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#54 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#55 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#56 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#57 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#58 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#59 Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#60 Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51109

#61 Updated by Tymoteusz Motylewski over 2 years ago

  • Status changed from Under Review to Resolved

#62 Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF