Bug #68040
openInline localize and/or synchronize does not respect sorting
0%
Description
Working with IRRE in multilingual projects you often have the situation, that elements have been translated already but they need to get additional content, which has been added to the default language records.
For this purpose there are two buttons in the editing form of the IRRE parent to either "localize" and/or "synchronize" the elements. While the first will just add new elements, the latter will even remove elements that have been deleted in the original language.
These actions are working quite well with a small exception: The sorting of the default language children is not respected, since new translated elements are just added after existing elements, even when they actually have been added between existing elements in the original language.
This leads to completely broken structures especially with deeper nesting levels of extensions like i.e. Gridelements. We noticed that while preparing the Localization Manager for Gridelements support and first thought it was a bug in either l10nmgr or GE. But while testing the manual localize/synchronize functionality, we found the same buggy behaviour.
IMHO the sorting must be synchronized from the default language after adding/removing elements in the target language.
Files
Updated by Jo Hasenau over 9 years ago
- Status changed from New to Accepted
- Complexity changed from easy to medium
It seems line 4588 of typo3/sysext/core/Classes/DataHandling/DataHandler.php just contains a wrong information about what's going to happen in the block below.
// Handle, reorder and store relations: if ($inlineSubType == 'list') { $updateFields = array($field => $value); } elseif ($inlineSubType == 'field') { $dbAnalysisCurrent->writeForeignField($config, $id); $updateFields = array($field => $dbAnalysisCurrent->countItems(FALSE)); } elseif ($inlineSubType == 'mm') { $dbAnalysisCurrent->writeMM($config['MM'], $id); $updateFields = array($field => $dbAnalysisCurrent->countItems(FALSE)); } // Update field referencing to child records of localized parent record: if (!empty($updateFields)) { $this->updateDB($table, $id, $updateFields); }
it just updates one field but does not reorder anything.
Updated by Jo Hasenau over 9 years ago
For the inline subtype "list" it works, since the CSV value is written into the field.
For "field" and "mm" there is no sorting at all.
Updated by Oliver Hader about 9 years ago
- File 68040_current.png 68040_current.png added
Is that the behavior your referring to (see screenshot)?
Updated by Mathias Schreiber about 9 years ago
- Target version deleted (
next-patchlevel)
Updated by Jo Hasenau over 7 years ago
- Has duplicate Bug #82109: Sorting of CEs in translation is wrong when localizing new CEs within gridelements added
Updated by Andreas Wolf over 7 years ago
I investigated this and found the culprit: It’s RelationHandler
, not DataHandler
. The sorting is indeed correct directly after translation, or at least it was in my test case—I cannot tell for sure for every use case.
The sorting is then messed up by RelationHandler::writeForeignField()
, which is called by DataHandler::inlineLocalizeSynchronize()
. AFAICS, the basic problem here is that the order of elements is already wrong in the data supplied by FormEngine, and this incorrect order is then apparently carried on to RelationHandler (while DataHandler at least in some cases does the sorting correctly, but that might also be by accident here).
I fear this is not easily fixable without potentially breaking other things. The best fix would probably be to get the order right in FormEngine already, but I did not manage to easily fix this (in TcaInline::resolveRelatedRecords()
). An additional problem here (in the context of connected mode) is that currently the ordering would be taken from the localized record, except for the non-localized records, and this did not work out in my tests.
Updated by Andreas Wolf over 7 years ago
Andreas Wolf wrote:
The sorting is then messed up by
RelationHandler::writeForeignField()
, which is called byDataHandler::inlineLocalizeSynchronize()
.
Further research and tests showed that this is incorrect. writeForeignField()
is called by DataHandler::remapListedDBRecords_procInline()
when processing the translated Gridelements container.
The value processed in remapListedDBRecords_procInline
comes from DataHandler->registerDBList[tt_content][<container UID>]
. It looks like this: "4,5,,8,", with the last ID being the new element. That value was in turn fetched from $dbAnalysisCurrent
, a RelationHandler
instance used in DataHandler::inlineLocalizeSynchronize()
Updated by Gerrit Code Review over 7 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/53739
Updated by Gerrit Code Review over 7 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/53739
Updated by Gerrit Code Review almost 7 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/53739
Updated by Gerrit Code Review almost 7 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/53739
Updated by Gerrit Code Review almost 7 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/53739
Updated by Markus Klein over 6 years ago
- Assignee deleted (
Jo Hasenau) - Target version set to 8.7.11
Updated by Gerrit Code Review over 6 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/53739
Updated by Gerrit Code Review over 6 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/53739
Updated by Markus Klein over 6 years ago
- Due date set to 2018-03-14
- Start date changed from 2015-07-10 to 2018-03-14
- Follows Bug #84228: Output error reasons if Build/Scripts/checkIntegrityCsvFixtures.php fails added
Updated by Oliver Hader over 6 years ago
- Target version changed from 8.7.11 to 8.7.12
Updated by Gerrit Code Review over 6 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/53739
Updated by Susanne Moog over 6 years ago
- Related to Bug #83079: wrong sorting of content elements when translating using non-default-language CEs as source added
Updated by Sybille Peters over 6 years ago
I'm adding a reproduce scenario. I used bootstrap carousel from bootstrap_package for testing.
- Create an element of type bootstrap carousel.
- Add 2 IRRE elements ("Carousel item")
- Translate the element with mode "Translate"
- Add another IRRE element in the content element of the original language
- Move the new IRRE element from third to second place
- Edit the translated element, click on "Synchronize with original language"
Expected: Now, in the translated element the 3 IRRE elements should be in the same order as in the original.
Actual result: In the translated element, the new IRRE element is added as last element (incorrect order)
Also, in the latest master an error message is displayed: "1: Localization failed; There already was a localization for this language of the record!"
Updated by Benni Mack over 6 years ago
- Target version changed from 8.7.12 to 8.7.19
Updated by Tymoteusz Motylewski over 6 years ago
- Related to Bug #83469: Translation of translations break sorting in tt_content added
Updated by Susanne Moog about 6 years ago
- Target version changed from 8.7.19 to Candidate for patchlevel
Updated by Gerrit Code Review almost 6 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/53739
Updated by Gerrit Code Review almost 6 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/53739
Updated by Gerrit Code Review almost 6 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/53739
Updated by Gerrit Code Review almost 6 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/53739
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/53739
Updated by Benni Mack about 4 years ago
- Related to Bug #50310: DataHandler fails to correctly re-sort (content) elements after moving one to top added
Updated by Gerrit Code Review about 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/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review almost 3 years ago
Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review almost 3 years ago
Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 20 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 21 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review over 1 year ago
Patch set 22 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739
Updated by Gerrit Code Review about 1 month ago
Patch set 23 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/53739