Bug #80855
closedStory #69617: FormEngine bugs
IRRE: "Localize all records" and "Synchronize with default language" not working anymore
100%
Description
A field using the following TCA definition:
'inline_relation' => [
'exclude' => TRUE,
'label' => 'Inline relation',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_myext_domain_model_child',
'foreign_field' => 'parent',
'foreign_sortby' => 'sorting',
'maxitems' => 9999,
'appearance' => [
'collapseAll' => 1,
'levelLinksPosition' => 'both',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'useSortable' => 1,
'showAllLocalizationLink' => 1
],
],
],
If I hit these buttons, nothing happens. I tried to do some debugging and i found the following:
FormInlineAjaxController::synchronizeLocalizeAction() on line 322 ($parentData = $formDataCompiler->compile($formDataCompilerInputForParent)), in $parentData['databaseRow'] the sys_language_uid field is set to [0 => 0] (the uid field contains the uid of the localized parent record) - shouldn't this be set to the correct language uid?
Therefore the $parentLanguage in line 325 is set to 0.
This results in the following $command array being passed to TYPO3\CMS\Core\DataHandling\DataHandler::inlineLocalizeSynchronize():
[
'field' => 'inline_relation',
'language' => '0',
'action' => 'localize'
]
This leads to the condition in DataHandler line 4869 being TRUE, which will cancel the processing:
$language = $command['language']; // = 0!
...
...
if (!$parentRecord || !is_array($parentRecord) || $language <= 0 || !$transOrigPointer) {
return;
}
These are my findings - not sure if this will help. If you need further info, just tell me.
Together with https://forge.typo3.org/issues/80080, IRRE localizations seem to be broken, which is a serious problem...
Files
Updated by Uwe Michelfelder over 7 years ago
Hi Kai,
this same problem accours to me, with the latest maintenance release of the 7 version starting with 7.6.17+.
This is really bad, because such a thing sneaks in into production system easily (which happened to us).
Uwe
Updated by Uwe Michelfelder over 7 years ago
After some digging I found the part, which breaks the behavoir.
In TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEditRow::addData on line 34 the code now look like
if ($result['command'] !== 'edit' || !empty($result['databaseRow'])) {
before that it was
if ($result['command'] !== 'edit') {
Removing the second condition makes the localize all function work again.
The code change was introduced here:
https://review.typo3.org/#/c/52003/
Updated by Gerrit Code Review over 7 years ago
- Status changed from New 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/52543
Updated by Christian Kuhn over 7 years ago
- Related to Task #80100: Bypass fetch of database record if already loaded added
Updated by Albrecht Köhnlein over 7 years ago
- Target version deleted (
8 LTS) - TYPO3 Version changed from 8 to 7
Updated by Albrecht Köhnlein over 7 years ago
I just found out, the transOrigPointerField
field is not set, too. Even with the applied patch. Could that be a related problem?
Updated by Mona Muzaffar over 7 years ago
- Related to Bug #80364: Localizing inline records fails added
Updated by Mona Muzaffar over 7 years ago
- Related to Bug #81055: Localisation of inline elements does not work in 7.6.18 added
Updated by Markus Dübbert over 7 years ago
- File localize.jpg localize.jpg added
- PHP Version changed from 7.1 to 5.6
I have the same bug when translating news articles.
TYPO3 7.6.18
news 6
The "Alle Datensätze lokalisieren" Button is without function.
This is very urgent because it happened on a live system.
Updated by Tymoteusz Motylewski over 7 years ago
- Target version set to next-patchlevel
Updated by Ralf Merz over 7 years ago
Hi Guys,
I just also want to confirm that "localize all records" is broken with version 7.6.17 and above.
Rolling back to 7.6.16 makes it work again.
I also can confirm the mentioned behavior for example when you want to localize fal_media in news.
Thanks in advance to roll this functionality back.
Cheers,
merzilla
Updated by König David over 7 years ago
- Has duplicate Bug #81175: IRRE synchronizeLocalizeRecords dont work since TYPO3 7.6.17 added
Updated by Stephan Auer over 7 years ago
I could also reproduce this error in TYPO3 8.7.1 LTS
Updated by Dmitry Dulepov over 7 years ago
I can confirm that the problem is definitely in change https://review.typo3.org/#/c/52003/5 as described at https://forge.typo3.org/issues/80855#note-2
Ajax handler for "Localize" and "Synchronoize" buttons does not add the full record for the database row, it just sets the uid:
FormInlineAjaxController::synchronizeLocalizeAction:
$formDataCompilerInputForParent = [
'vanillaUid' => (int)$parent['uid'],
'command' => 'edit',
'tableName' => $parent['table'],
'databaseRow' => [
// TcaInlineExpandCollapseState needs this
'uid' => (int)$parent['uid'],
],
'inlineFirstPid' => $inlineFirstPid,
'columnsToProcess' => [
$parentFieldName
],
// @todo: still needed? NO!
'inlineStructure' => $inlineStackProcessor->getStructure(),
// Do not compile existing children, we don't need them now
'inlineCompileExistingChildren' => false,
];
So that change breaks localization in forms.
Updated by Jo Hasenau over 7 years ago
So the actual bug is
'databaseRow' => [ // TcaInlineExpandCollapseState needs this 'uid' => (int)$parent['uid'], ],instead of
'databaseRow' => $parentwhich just has been revealed by the changes in 52003
IMHO this should be fixed in all those places that do not provide the full record.
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/52543
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53209
Updated by Anonymous over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b6482afe70199b406d1e017c7b614407076a45cd.
Updated by Gerrit Code Review over 7 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/53210
Updated by Anonymous over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 51d227a2d8b82d038282facc112776131fbdb1d3.