Project

General

Profile

Actions

Bug #79853

closed

Exception when setting "Language" to "all" for new and/or existing content elements in backend

Added by Michael Fruehmann almost 8 years ago. Updated almost 7 years ago.

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

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

Description

I have a very weird issue on TYPO3 8.6 and cannot find out where to start looking: It’s an almost empty installation with a main and a second language, whenever I try t o set a content element to “Language ALL” i get an exception in the backend.
If I set the sys_language_uid to -1 manually in the DB the content element is shown with the “all” settings and displayed correctly in the frontend, but I cannot add or edit another content element on the same page (always throws same error).
I setup a TYPO3 7.6 with exactly the same setup and it works as expected there. It does not depend on any language overlay TS settings.

(See attached animated gif) or https://dl.dropboxusercontent.com/u/81358/jing/language-all.gif

Argument 3 passed to TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::synchronizeFieldValues() must be of the type array, null given, called in /Applications/MAMP/htdocs/__typo3_source/typo3_src-8.6.0/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php on line 253 

TypeError thrown in file
/Applications/MAMP/htdocs/__typo3_source/typo3_src-8.6.0/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php in line 323.

PHP version used was 7.0.12.
(this is my first core bug that I file, please be considerate if I forgot something :)


Files

language-all.gif (169 KB) language-all.gif Michael Fruehmann, 2017-02-16 10:56

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #79658: Introduce allowLanguageSynchronizationClosed2017-02-07

Actions
Related to TYPO3 Core - Bug #79872: records throw an error on language -1Closed2017-02-17

Actions
Related to TYPO3 Core - Bug #83940: L10nModeUpdater breaks if parent of translations is deletedClosed2018-02-16

Actions
Actions #1

Updated by Christian Kuhn almost 8 years ago

  • Priority changed from -- undefined -- to Must have
  • Sprint Focus set to Stabilization Sprint
Actions #2

Updated by Georg Ringer almost 8 years ago

  • Status changed from New to Accepted
  • Is Regression changed from No to Yes
Actions #3

Updated by Timo Hund almost 8 years ago

I am looking at this

Actions #4

Updated by Nicole Cordes almost 8 years ago

  • Assignee set to Timo Hund
Actions #5

Updated by Timo Hund almost 8 years ago

I had a look on the issue. The reason for the error is, that in the method synchronizeTranslationItem BackendUtility::getRecordWSOL is called with tt_content, and record uid 0 in this case and this record can't exist.

When i add a check in the method "synchronizeTranslationItem" and skip the sychronisation process then (what makes sence in my opinion) i don't get this error anymore:

    protected function synchronizeTranslationItem(DataMapItem $item, array $fieldNames, int $fromId)
    {
        if ($fromId === 0) {
            return;
        }
         ...

Since i am not so deep in the translation handling i don't know if this could have any other side effects. Maybe somebody else can help and knows why this can happen?

Actions #6

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

Actions #7

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

Actions #8

Updated by Gerrit Code Review almost 8 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51804

Actions #9

Updated by Gerrit Code Review almost 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51804

Actions #10

Updated by Gerrit Code Review almost 8 years ago

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

Actions #11

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

Actions #12

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

Actions #13

Updated by Timo Hund almost 8 years ago

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

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

Actions #15

Updated by Oliver Hader over 7 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Bert Hiddink over 7 years ago

When upgrading from 7.x to 8.7.2 and running the step "Execute database migrations on single rows" with the upgradeWizard from Install Tool, I get the following error:

Argument 3 passed to TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::synchronizeFieldValues() must be of the type array, null given, called in typo3_src-8.7.2/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php on line 316

TypeError thrown in file
typo3_src-8.7.2/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php in line 384.

Seems very similar to this bug https://forge.typo3.org/issues/79853 but this seems already having been resolved in the 8.6-branch.

Any ideas where this error comes from?

Actions #17

Updated by christian rauch over 7 years ago

This happens with translated records whose parents are deleted (deleted=1)

for example:

tt_content:

uid=1, l18n_parent=0, sys_language_uid=0, deleted=1
uid=2, l18n_parent=1, sys_language_uid=1, deleted=0 ======> Error

I didn't dig any deeper as i tried to update from a typo3 4.5 Project to 8 LTS and there were only 2 records where this error happened

Actions #18

Updated by Jonas Enders about 7 years ago

To fix the problem mentioned by christian rauch, I wrote a sql statement:

CREATE TEMPORARY TABLE tmp SELECT child.uid FROM tt_content AS parent INNER JOIN tt_content AS child ON (child.l18n_parent = parent.uid) WHERE parent.deleted = 1 AND child.deleted = 0;
DELETE FROM tt_content WHERE uid IN (SELECT uid FROM tmp);
DROP TABLE tmp;
Actions #19

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions #20

Updated by Kurt Gusbeth about 7 years ago

Uncaught TYPO3 Exception
Argument 3 passed to TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::synchronizeFieldValues() must be of the type array, null given, called in /html/typo3/typo3_src-8.7.8/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php on line 320

TypeError thrown in file
/html/typo3/typo3_src-8.7.8/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php in line 384.

and

CREATE TEMPORARY TABLE tmp SELECT child.uid FROM tt_content AS parent INNER JOIN tt_content AS child ON (child.l18n_parent = parent.uid) WHERE parent.deleted = 1 AND child.deleted = 0;
  1. MySQL lieferte ein leeres Resultat zurück (d.h. null Datensätze).
    DELETE FROM tt_content WHERE uid IN (SELECT uid FROM tmp);
  2. MySQL lieferte ein leeres Resultat zurück (d.h. null Datensätze).
    DROP TABLE tmp;
  3. MySQL lieferte ein leeres Resultat zurück (d.h. null Datensätze).

Nothing helped for me.
I fixed it like this:

        foreach ($fieldNames as $fieldName) {
            if (is_array($fromRecord) && is_array($forRecord)) {
                $this->synchronizeFieldValues(
                    $item,
                    $fieldName,
                    $fromRecord,
                    $forRecord
                );
            }
        }

Actions #21

Updated by Martin Waue almost 7 years ago

I had to delete child records without parent records.


SELECT uid,l18n_parent FROM `tt_content` WHERE l18n_parent NOT IN (SELECT uid FROM tt_content) AND l18n_parent > 0

Actions #22

Updated by Joerg Kummer almost 7 years ago

  • Related to Bug #83940: L10nModeUpdater breaks if parent of translations is deleted added
Actions #23

Updated by Joerg Kummer almost 7 years ago

I added a patch at #83940 with the suggestion from Kurt Gusbeth

Actions

Also available in: Atom PDF