Review 10.4 Merged

68612[BUGFIX] Add pid restriction when getting previousLocalizedRecord

Christian Kuhn CR +2 V +2 Hard +512 −2 updated 03/25/21, 16:53

Commit message

Scenario:
A content element 'ce-1-default' exists on a 'source' page. It
has a 'free mode' localization 'ce-1-localized'. The localized
content element thus has l18n_parent=0 (free mode) and
l10n_source='id-of-ce-1-default' - it has been derived from
'ce-1-default'.

Now 'ce-1-default' is moved to a different 'target' page. Due to
free mode, 'ce-1-localized' is NOT moved along with it's localization
source, but keeps l10n_source='id-of-ce-1-default' (this needs to be
discussed if we change this) and stays on 'source' page. This is ok.

Now, a new content element 'ce-2-default' is added on 'target' page,
right below the previously moved 'ce-1-default'. And then, this element
is localized.

DataHandler now tries to find out where to create this localized
'ce-2-localized' record relative to other records. It find the
localization 'ce-1-localized' due to it's l10n_source indicator
and then creates 'ce-2-localized' after 'ce-1-localized'. On the
source page!
So the content element localization ends up on a different page,
which is of course wrong, misleading and hard to understand!

To fix this, the Datahandler now finds translated content elements
of a given content element only if it is on the same page. This
keeps this 'relative-to' magic, and the content element does not
end up on some foreign page.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 17