Project

General

Profile

Actions

Bug #83940

closed

L10nModeUpdater breaks if parent of translations is deleted

Added by Joerg Kummer over 6 years ago. Updated over 5 years ago.

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

100%

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

Description

Referring to #79853, and as Bert Hiddink mentioned: installtool upgrade wizard 'Execute database migrations on single rows' with 'L10nModeUpdater' returns error, if for example translated tt_content entries have deleted parent entries.

Argument 3 passed to TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::synchronizeFieldValues() must be of the type array, null given …

To find such entries in table tt_content

SELECT child.uid, child.pid, child.header, child.sys_language_uid, child.l18n_parent
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
To reproduce:
  • create tt_content element plus translation
  • set field 'deleted' of parent language element to 1
  • mark upgrade wizard 'Execute database migrations on single rows' as undone (installtool)
  • run upgrade wizard 'Execute database migrations on single rows'

Hint: Upgrade wizard ’Execute database migrations on single rows' has three different tasks (L10nModeUpdater, ImageCropUpdater,RteLinkSyntaxUpdater)
where in this case only L10nModeUpdater is affected. In DB:sys_registry.entry_key = rowUpdatersDone AND entry_namespace = installUpdateRows
the serialized values can be manipulated to force only L10nModeUpdater.
Set DB:sys_registry.entry_value for this row to

a:2:{i:0;s:53:"TYPO3\CMS\Install\Updates\RowUpdater\ImageCropUpdater";i:1;s: 57:"TYPO3\CMS\Install\Updates\RowUpdater\RteLinkSyntaxUpdater";}

A workaround is to set such parent entries temporarly to not being deleted, during upgrade wizard:

Befor running upgrade wizard ’Execute database migrations on single rows' set field 'deleted' for such entries to 0:

# Add temporary field for deletion
ALTER TABLE tt_content ADD deleted_temp smallint(5) UNSIGNED NOT NULL DEFAULT '0';
# Copy deletion to temporary field and set deletion to 0
UPDATE tt_content AS parent INNER JOIN (SELECT uid, l18n_parent, deleted FROM tt_content) AS child ON parent.uid=child.l18n_parent
SET parent.deleted_temp = 1, parent.deleted = 0
WHERE parent.deleted=1 AND child.deleted=0

Then run upgrade wizard ’Execute database migrations on single rows’.

After running the upgrade wizard rollback and reset 'deleted' field to origin values:

# Reset deletion to origin value
UPDATE tt_content SET deleted = deleted_temp WHERE deleted_temp = 1;
# Drop temporary field
ALTER TABLE tt_content DROP deleted_temp;

Kurt Gusbeth wrote a solution in #79853, which should be included, cause method DataMapProcessor->synchronizeFieldValues requires third and forth argument to be of kind array. I will apply a patch for this.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #79853: Exception when setting "Language" to "all" for new and/or existing content elements in backendClosedTimo Hund2017-02-16

Actions
Actions #1

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

Actions #2

Updated by Joerg Kummer over 6 years ago

  • Related to Bug #79853: Exception when setting "Language" to "all" for new and/or existing content elements in backend added
Actions #3

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

Actions #4

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

Actions #5

Updated by Joerg Kummer over 6 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF