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

Added by Andreas Allacher almost 4 years ago. Updated about 1 month ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
Localization
Target version:
Start date:
2014-11-20
Due date:
% Done:

0%

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

Description

When I have IRRE records and I modify the language field, e.g. to set it from "0" to "-1" the child records are not updated to that language field but are kept at the ones during creation.
Except "-1" that one never seems to be used.
This can be problematic under certain circumstances, e.g. extbase will not deliver the file anymore via the datamapper as the language of the sys_file_reference is not included.


Related issues

Related to TYPO3 Core - Bug #57272: Extbase doesn't handle FAL translations correctly Closed 2014-03-25
Related to TYPO3 Core - Bug #59734: Translating a CE containing inline elements doesn't apply language to inline elements New 2014-06-20
Related to TYPO3 Core - Bug #71712: 7 LTS: sys_file_reference IRRE elements not shown anymore in alternate languages Closed 2015-11-20
Related to Grid Elements - Bug #75373: CEs are copied with wrong language when translating gridelements via the "Copy" mode Rejected 2016-04-01
Related to TYPO3 Core - Bug #75400: Related child elements don't get correct sys_language_uid during localization of parent record Closed 2016-04-04
Related to TYPO3 Core - Bug #76048: IRRE: Child records - New record doesn't get language of parent (non localized records but using new button) Closed 2016-05-04
Related to Grid Elements - Bug #77756: Translated elements are not moved within grid container, when language parent is moved - Regression? Resolved 2016-09-01
Related to TYPO3 Core - Bug #48883: Wrong sys_language_uid in sys_file_reference Closed 2013-06-05
Duplicated by Grid Elements - Bug #82115: Copy & Paste into other language does not set sys_language_uid Closed 2017-08-16

History

#1 Updated by Andreas Allacher almost 4 years ago

This might be related to some others but the others do not exactly describe this behaviour but might be a result of this.

To auto-change this field might only be interesting under certain circumstances, e.g. if hideTable is active and the language field is not visible (hidden palette).

#2 Updated by Andreas Allacher almost 4 years ago

It is even worse when creating a new record, e.g. I create a content element and change the language to non default, the sub-records (e.g. case images) will not have the selected language but the default value (if available, otherwise it has the first available value).

#3 Updated by Andreas Allacher almost 4 years ago

Also if the parent record is set to all language (-1) it the child record will be set to default language, even if the child record is a new record and the parent record is already existed because the select is like this:
if ($parentRecord[$parentLanguageField] > 0) {
$record[$childLanguageField] = $parentRecord[$parentLanguageField];
}

#4 Updated by Andreas Allacher over 3 years ago

Just wanted to ask if I need to provide additional information or has there already be something done in regards to this?

#5 Updated by Jo Hasenau over 3 years ago

  • Target version set to next-patchlevel

Just came across that issue while looking for a solution of sorting problems in translated records.

IMHO a parent record with a language set to "all" should be allowed to contain elements with all available language settings. So switching the children to "all" as well would be unexpected at least for my personal taste.

In any other case children should of course be switched to the selected language, since otherwise they will just diseappear in BE and/or FE views.

#6 Updated by Andreas Allacher over 3 years ago

So you mean the possibility to have the container for all languages but the sub elements for certain languages only?
That might already be an issue in how to display it in the page view.

In any case, even if we allow this, the default setting should still be "-1" for child records and it should at least be possible to create those and not set default to 0
Even if someone were to change thme later on.

Also most users don't have access to the language selector for a record directly, so they can not really select the language here at all.

#7 Updated by Mathias Schreiber almost 3 years ago

  • Target version deleted (next-patchlevel)

#8 Updated by Jo Hasenau almost 3 years ago

  • Category set to Localization

Actually this one seems to be the reason why "Translate" does not work in "copy" mode for children of copied records in CMS 7.

As far as I can see the LocalizationController uses "paste" and "update" on the parent record. So actually it does the same as if an editor just changed the language of that parent record manually. So translations of containers currently work for localization of default language records only.

            if ($params['action'] === 'localize') {
                if ($srcLanguageId === 0) {
                    $cmd['tt_content'][$currentUid] = [
                        'localize' => $destLanguageId
                    ];
                } else {
                    $cmd['tt_content'][$currentUid] = [
                        'copy' => [
                            'action' => 'paste',
                            'target' => $pageId,
                            'update' => [
                                'sys_language_uid' => $destLanguageId
                            ]
                        ]
                    ];
                }
            } else {
                $cmd['tt_content'][$currentUid] = [
                    'copy' => [
                        'action' => 'paste',
                        'target' => $pageId,
                        'update' => [
                            'sys_language_uid' => $destLanguageId,
                            'l18n_parent' => 0
                        ]
                    ]
                ];
            }

#9 Updated by Andreas Allacher over 2 years ago

What might also be an issue is if one changes the language field and adds new child records without saving, the new child record most likely will have the old language uid as value.

#10 Updated by Jo Hasenau about 2 years ago

We discussed that during the coding night and came to the conclusion that #75400 should be fixed by pushing a change of sys_language_uid to any connected child element within the process_datamap() method.

This will not just fix the so called "Copy" mode of the translation modal then, but any this issue as well.

As soon as there is sys_language_uid in the field Array directly after the processDatamap_postProcessFieldArray hook during an update of an existing record, this must push the language to the chain of child elements, excet the value is -1, since this might contain any possible language for children.

#11 Updated by Jo Hasenau about 2 years ago

  • Status changed from New to Accepted
  • Assignee set to Jo Hasenau
  • Target version set to next-patchlevel
  • TYPO3 Version changed from 6.2 to 7

This won't be fixed for 6.2 though, but at least for 7.6 since it will fix the broken copy mode of the localization modal.

#12 Updated by Andreas Allacher about 2 years ago

In regards to -1, fair enough but it should at least create newly created children with -1

Though if for example one has a content element at the default language with one image and one wants to move it to language uid -1
then one would need to modify BOTH the CE and the file to -1 with your suggestion.

However, by default the file reference doesn't display the sys language uid so that is not possible.

Maybe if child has the same sys language uid as the parent then did previously it should also be moved to all languages (or at least if parent and child are default language)?
If not, maybe as an optional feature?

#13 Updated by Gerrit Code Review about 2 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/49805

#14 Updated by Gerrit Code Review about 2 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/49805

#15 Updated by Gerrit Code Review about 2 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/49805

#16 Updated by Gerrit Code Review about 2 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/49805

#17 Updated by Gerrit Code Review about 2 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/49805

#18 Updated by Reinhard F├╝hricht over 1 year ago

Hi guys!

Is there any news on this issue?
We are currently having severe problems with this bug and it would be really cool to have this fixed soon.

#19 Updated by Coders.Care Extension Team about 1 year ago

  • Duplicated by Bug #82115: Copy & Paste into other language does not set sys_language_uid added

#20 Updated by Anja Leichsenring 4 months ago

  • Status changed from Under Review to Needs Feedback

the patch is in WIP since a year.
After latest changes to the localisation behaviour, is this issue still relevant?

#21 Updated by Andreas Allacher 4 months ago

I am not sure - haven't tested the exact behaviour in some time but I guess some issues still exist - at least some of the related tasks are still open. Though some have been closed.

#22 Updated by Christian Kuhn about 1 month ago

  • Status changed from Needs Feedback to Rejected

patch has been abandoned from review queue since nothing happened on it for about 2 years. to continue work on this issue, please open a new one, gather all available information, link this issue and explain use cases and possible solutions again, please.

Also available in: Atom PDF