Bug #80855

Story #69617: FormEngine bugs

IRRE: "Localize all records" and "Synchronize with default language" not working anymore

Added by Kai Tallafus over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Localization
Target version:
Start date:
2017-04-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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

localize.jpg (116 KB) localize.jpg Markus Dübbert, 2017-05-04 20:22

Related issues

Related to TYPO3 Core - Task #80100: Bypass fetch of database record if already loadedClosedXavier Perseguers2017-03-02

Actions
Related to TYPO3 Core - Bug #80364: Localizing inline records failsClosed2017-03-21

Actions
Related to TYPO3 Core - Bug #81055: Localisation of inline elements does not work in 7.6.18Closed2017-04-28

Actions
Has duplicate TYPO3 Core - Bug #81175: IRRE synchronizeLocalizeRecords dont work since TYPO3 7.6.17Rejected2017-05-10

Actions
#1

Updated by Uwe Michelfelder over 3 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

#2

Updated by Uwe Michelfelder over 3 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/

#3

Updated by Gerrit Code Review over 3 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

#4

Updated by Christian Kuhn over 3 years ago

  • Related to Task #80100: Bypass fetch of database record if already loaded added
#5

Updated by Albrecht Köhnlein over 3 years ago

  • Is Regression set to Yes
#6

Updated by Albrecht Köhnlein over 3 years ago

  • Target version deleted (8 LTS)
  • TYPO3 Version changed from 8 to 7
#7

Updated by Albrecht Köhnlein over 3 years ago

I just found out, the transOrigPointerField field is not set, too. Even with the applied patch. Could that be a related problem?

#8

Updated by Mona Muzaffar over 3 years ago

  • Related to Bug #80364: Localizing inline records fails added
#9

Updated by Mona Muzaffar over 3 years ago

  • Related to Bug #81055: Localisation of inline elements does not work in 7.6.18 added
#10

Updated by Markus Dübbert over 3 years ago

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.

#11

Updated by Tymoteusz Motylewski over 3 years ago

  • Target version set to next-patchlevel
#12

Updated by Ralf Merz over 3 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

#13

Updated by König David over 3 years ago

  • Has duplicate Bug #81175: IRRE synchronizeLocalizeRecords dont work since TYPO3 7.6.17 added
#14

Updated by Stephan Auer over 3 years ago

I could also reproduce this error in TYPO3 8.7.1 LTS

#15

Updated by Dmitry Dulepov over 3 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.

#16

Updated by Jo Hasenau over 3 years ago

So the actual bug is

'databaseRow' => [
    // TcaInlineExpandCollapseState needs this
    'uid' => (int)$parent['uid'],
],
instead of
'databaseRow' => $parent
which 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.

#17

Updated by Christian Kuhn over 3 years ago

  • Parent task set to #69617
#18

Updated by Gerrit Code Review over 3 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

#19

Updated by Gerrit Code Review over 3 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

#20

Updated by Anonymous over 3 years ago

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

Updated by Gerrit Code Review over 3 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

#22

Updated by Anonymous over 3 years ago

  • Status changed from Under Review to Resolved
#23

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF