Bug #83940

L10nModeUpdater breaks if parent of translations is deleted

Added by Joerg Kummer over 1 year ago. Updated 12 months ago.

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

100%

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

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

Associated revisions

Revision a00fd09d (diff)
Added by Joerg Kummer over 1 year ago

[BUGFIX] Ensures call of synchronizeFieldValues with valid arguments

Let 8.7 installtool upgrade wizard L10nModeUpdater ignore synchronization if parent entry of given translations is set to deleted

Resolves: #83940
Releases: master, 8.7
Change-Id: Ie240f71ecf42564c0547abd2dfa5c5efb23c6385
Reviewed-on: https://review.typo3.org/55758
Tested-by: TYPO3com <>
Reviewed-by: Tobi Kretschmann <>
Tested-by: Tobi Kretschmann <>
Reviewed-by: Joerg Kummer <>
Tested-by: Joerg Kummer <>
Reviewed-by: Michael Semle <>
Tested-by: Michael Semle <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 14499f1d (diff)
Added by Joerg Kummer over 1 year ago

[BUGFIX] Ensures call of synchronizeFieldValues with valid arguments

Let 8.7 installtool upgrade wizard L10nModeUpdater ignore synchronization if parent entry of given translations is set to deleted

Resolves: #83940
Releases: master, 8.7
Change-Id: Ie240f71ecf42564c0547abd2dfa5c5efb23c6385
Reviewed-on: https://review.typo3.org/55825
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review over 1 year 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

#2 Updated by Joerg Kummer over 1 year ago

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

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

#4 Updated by Gerrit Code Review over 1 year 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

#5 Updated by Joerg Kummer over 1 year ago

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

#6 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF