Bug #57063
closedParent language is not applied to new child records
100%
Description
Hi!
When creating a element in another language than the default language and adding a child element via IRRE, i am expecting that the child element gets the same language as the parent element.
For instance a news element from tx_news:
- Create new news element and choose a language which is not defined as default
- save
- add a media element via irre
- now you have to select the language in the media element again
This behaviour is not very usable for editors.
Files
Updated by David Greiner almost 11 years ago
- File InlineElement.patch InlineElement.patch added
I think there is a bug in /typo3/sysext/backend/Classes/Form/Element/InlineElement.php
Defining
'behaviour' => array( 'localizationMode' => 'select', ... ),
should be neccessary since it is described in http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Inline/Index.html#columns-inline-properties-behaviour
Adding this to the TCA configuration does not take effect cause of InlineElement.php:1223 checks for $config['localizationMode'] and not for $config['behaviour']['localizationMode'].
This is what the attached patch updates.
The patch is for the current master branch (6.2) in https://git.typo3.org/Packages/TYPO3.CMS.git
Updated by David Greiner almost 11 years ago
- File InlineElement_2nd.patch InlineElement_2nd.patch added
Second patch is better.
Updated by Oliver Hader over 10 years ago
- Status changed from New to Accepted
- Complexity set to medium
I'll have a look - thx for the patch!
Besides that, I could reproduce the misbehavior.
Updated by Oliver Hader over 10 years ago
- Subject changed from IRRE: Use localization of parent element to Parent language is not applied to child records
Updated by Oliver Hader over 10 years ago
- Subject changed from Parent language is not applied to child records to Parent language is not applied to new child records
Updated by Gerrit Code Review over 10 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/30448
Updated by Oliver Hader over 10 years ago
David, I modified your patch a little bit, however it was the correct place and correct bug analysis! Good catch & thanks!
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30472
Updated by Teamgeist Medien over 10 years ago
Just wasted a half day with handling the complications without this function working. Thanks alot!
Updated by David Greiner over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3e6e8ec89c00b04485a3c6050e0cfdd9548a213e.
Updated by Markus Opahle almost 9 years ago
Looks like this bug reappears in 7.6 LTS.
The fix from 3e6e8ec89c00b04485a3c6050e0cfdd9548a213e is commented out in TYPO3\CMS\Backend\Controller\FormInlineAjaxController on line 139:
// Set language of new child record to the language of the parent record: // @todo: To my understanding, the below case can't happen: With localizationMode select, lang overlays // @todo: of children are only created with the "synchronize" button that will trigger a different ajax action. // @todo: The edge case of new page overlay together with localized media field, this code won't kick in either. /** if ($parent['localizationMode'] === 'select' && MathUtility::canBeInterpretedAsInteger($parent['uid'])) { $parentRecord = $inlineRelatedRecordResolver->getRecord($parent['table'], $parent['uid']); $parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField']; $childLanguageField = $GLOBALS['TCA'][$child['table']]['ctrl']['languageField']; if ($parentRecord[$parentLanguageField] > 0) { $record[$childLanguageField] = $parentRecord[$parentLanguageField]; } } */
Updated by Tymoteusz Motylewski about 8 years ago
Markus, is it still an issue with current v7 or 8 branch? If yes, plase open a new ticket with steps to reproduce the issue? I tried to reproduce but I couldn't.