Project

General

Profile

Actions

Bug #80855

closed

Story #69617: FormEngine bugs

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

Added by Kai Tallafus about 7 years ago. Updated over 5 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 4 (0 open4 closed)

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
Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

Updated by Christian Kuhn about 7 years ago

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

Updated by Albrecht Köhnlein about 7 years ago

  • Is Regression set to Yes
Actions #6

Updated by Albrecht Köhnlein about 7 years ago

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

Updated by Albrecht Köhnlein about 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?

Actions #8

Updated by Mona Muzaffar almost 7 years ago

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

Updated by Mona Muzaffar almost 7 years ago

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

Updated by Markus Dübbert almost 7 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.

Actions #11

Updated by Tymoteusz Motylewski almost 7 years ago

  • Target version set to next-patchlevel
Actions #12

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

Actions #13

Updated by König David almost 7 years ago

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

Updated by Stephan Auer almost 7 years ago

I could also reproduce this error in TYPO3 8.7.1 LTS

Actions #15

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

Actions #16

Updated by Jo Hasenau almost 7 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.

Actions #17

Updated by Christian Kuhn almost 7 years ago

  • Parent task set to #69617
Actions #18

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

Actions #19

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

Actions #20

Updated by Anonymous almost 7 years ago

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

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

Actions #22

Updated by Anonymous almost 7 years ago

  • Status changed from Under Review to Resolved
Actions #23

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF