Bug #79853
closed
Exception when setting "Language" to "all" for new and/or existing content elements in backend
Added by Michael Fruehmann about 7 years ago.
Updated about 6 years ago.
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
- Priority changed from -- undefined -- to Must have
- Sprint Focus set to Stabilization Sprint
- Status changed from New to Accepted
- Is Regression changed from No to Yes
- Assignee set to Timo Hund
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?
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- Status changed from Under Review to Resolved
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?
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
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;
- Status changed from Resolved to Closed
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;
- MySQL lieferte ein leeres Resultat zurück (d.h. null Datensätze).
DELETE FROM tt_content WHERE uid IN (SELECT uid FROM tmp);
- MySQL lieferte ein leeres Resultat zurück (d.h. null Datensätze).
DROP TABLE tmp;
- 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
);
}
}
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
- Related to Bug #83940: L10nModeUpdater breaks if parent of translations is deleted added
I added a patch at #83940 with the suggestion from Kurt Gusbeth
Also available in: Atom
PDF