Bug #76048

Story #69712: Further FormEngine development

IRRE: Child records - New record doesn't get language of parent (non localized records but using new button)

Added by Andreas Allacher about 3 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
FormEngine aka TCEforms
Start date:
2016-05-04
Due date:
% Done:

100%

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

Description

Since 7.6 if one adds a new record to an existing record which is not in the default language, the newly created child record will not receive the language of the parent record.
This is not a problem if the record is localized BUT:
1.) There might not be a language parent to the main record - record only exists in selected language
2.) It might be possible to add additional child records to those of the parent record

The issue seems to be:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php#l133

The commented out code here. Though I think with 7.6 we should move the code to a DataHandler.

I also don't think it helps if one creates a new record, changes it language and adds a child record prior to saving, see related issue.


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 #75040: placeholder pointing to column of related record shows values from wrong language Closed 2016-03-14
Related to TYPO3 Core - Bug #78897: file references consider wrong language uid for metadata Closed 2016-12-06
Related to TYPO3 Core - Bug #73609: Creating IRRE child element without language of parent element Closed 2016-02-22
Related to TYPO3 Core - Bug #48883: Wrong sys_language_uid in sys_file_reference Closed 2013-06-05
Related to TYPO3 Core - Feature #60026: Set explicitly 'readOnly' sys_language_uid of child to value, taken from parent record New 2014-07-01
Related to TYPO3 Core - Bug #76181: Languagefield-value of new inline relations is not in sync with the language of its parent element Closed 2016-05-13
Related to TYPO3 Core - Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA Closed 2017-09-07

Associated revisions

Revision c4c2ae46 (diff)
Added by Nicole Cordes over 2 years ago

[BUGFIX] Set language uid for inline children by default

On creating child records for an inline field, currently no language
is set and the children are stored with sys_language_uid 0. This patch
adds the proper configuration to ensure a default children language
according to its parent language.

Resolves: #48883
Resolves: #76048
Resolves: #73609
Releases: master, 7.6
Change-Id: Id9e449dbb06fed11670eedec45a92529fb4acb6f
Reviewed-on: https://review.typo3.org/52061
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Tobi Kretschmann <>
Reviewed-by: Frank N├Ągler <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision d9e99922 (diff)
Added by Nicole Cordes over 2 years ago

[FOLLOWUP][BUGFIX] Set language uid for inline children by default

Resolves: #48883
Resolves: #76048
Resolves: #73609
Releases: master, 7.6
Change-Id: Id782bd41bfe30d9f9574e4b444d6e361ac76d0c6
Reviewed-on: https://review.typo3.org/52148
Reviewed-by: Wouter Wolters <>
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision 9d3aa861 (diff)
Added by Susanne Moog almost 2 years ago

[BUGFIX] Set language uid for inline children by default

On creating child records for an inline field, currently no language
is set and the children are stored with sys_language_uid 0. This patch
adds the proper configuration to ensure a default children language
according to its parent language.

Resolves: #48883
Resolves: #76048
Resolves: #73609
Releases: master, 7.6
Change-Id: Id9e449dbb06fed11670eedec45a92529fb4acb6f
Reviewed-on: https://review.typo3.org/53206
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>

History

#1 Updated by Andreas Allacher about 3 years ago

Things that the old implementation didn't take care of:
1.) Setting the language to -1 for all wasn't transferred to childs, as the check was > 0, it should be != 0 or just set it always.
2.) Bug #63092
3.) Related to bug #63092: If one changes the language and creates a new child record prior to saving it will be created with the old langauge uid.

#2 Updated by Christian Kuhn about 3 years ago

  • Parent task set to #69712

#3 Updated by Jo Hasenau almost 3 years ago

  • Status changed from New to Accepted
  • Assignee set to Jo Hasenau

-1 means "all", so this should not be transferred to children, since a parent element with that setting can contain children in any available language.
So the check should be > -1, since 0 should be transferred to children for example when switching back to the default language.

#4 Updated by Andreas Allacher almost 3 years ago

Maybe not transferred to existing children but I think newly created children should have -1 if the parent has -1, shouldn't it?

In regards to existing childs I have commented further in that regard in ticket #63092

#5 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

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/52061

#6 Updated by Gerrit Code Review over 2 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/52061

#7 Updated by Gerrit Code Review over 2 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/52061

#8 Updated by Gerrit Code Review over 2 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/52061

#9 Updated by Gerrit Code Review over 2 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/52061

#10 Updated by Gerrit Code Review over 2 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/52061

#11 Updated by Nicole Cordes over 2 years ago

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

#12 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved 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/52148

#13 Updated by Nicole Cordes over 2 years ago

  • Status changed from Under Review to Resolved

#14 Updated by Viktor Livakivskyi about 2 years ago

  • Related to Feature #60026: Set explicitly 'readOnly' sys_language_uid of child to value, taken from parent record added

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

#16 Updated by Gerrit Code Review about 2 years ago

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/53206

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

#18 Updated by Gerrit Code Review about 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/53206

#19 Updated by Gerrit Code Review about 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/53206

#20 Updated by Gerrit Code Review about 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/53206

#21 Updated by Anonymous almost 2 years ago

  • Status changed from Under Review to Resolved

#22 Updated by Tymoteusz Motylewski almost 2 years ago

The backport to v7 has been merged (https://review.typo3.org/#/c/53206/)
Few notes:
1) Now NEW irre elements (including FAL relations) will get a sys_language_uid of their parent.
2) There is no automatic migration of the old record having inccorrect value in the sys_language_uid.
3) The issue has been solved on the FormEngine level, thus you need to make sure you have
sys_language_uid field in the showitem list in your TCA.

Often you don't want to show the sys_language field to the user, so there is a little trick, which will make stuff work without showing the field to the user.
You just need to create a hidden palette with sys_language_uid in it.
e.g.

'showitem' = '... --palette--;;hiddenLanguagePalette,';
'hiddenLanguagePalette' => [
    'showitem' => 'sys_language_uid, l10n_parent',
         'isHiddenPalette' => true,
],

See TCA for sys_file_reference where this approach is used, or this pull request as a reference https://github.com/benjaminkott/bootstrap_package/pull/458

#23 Updated by Tymoteusz Motylewski almost 2 years ago

  • Related to Bug #76181: Languagefield-value of new inline relations is not in sync with the language of its parent element added

#24 Updated by Mathias Brodala almost 2 years ago

  • Related to Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA added

#25 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF