Review main Merged

71094[BUGFIX] No MM relations when localizing categories

Christian Kuhn CR +2 V +2 Normal +84 −31 updated 09/16/21, 15:14

Commit message

"True" MM relations (those tables that have a "uid_local"
and "uid_foreign" db column and NO TCA) have a "local" and
a "foreign" side. For instance with categories, the category
table is the "local" side, and the referencing table "pages",
"tt_content", or whatever table, is the foreign side.

Without the patch, MM table rows when localizing the local
side of an MM relation is buggy, scenario:

A default language tt_content record references
a default language category. This gives one row in the mm
table. If now the category is localized, a second entry
from the localized category to the default language content
element is added. This is wrong.

The patch fixes this in the DataHandler by setting a
dedicated override for this "local side localization" scenario,
so the RelationHandler omits MM processing in this case. A
functional test is added for non-workspace that exists
for workspace already to verify a new relation can still
be added when creating the local side.

Note this is only half of the picture - MM relation should
still be set and updated when a localized foreign side exists
for the just localized local side. This does not happen
currently and leads to broken MM rows even with the patch. This
scenario however needs a bigger refactoring and further
increased coverage and will be handled with further patches.

Still, this patch is relatively straight forward, increases
test coverage for future patches and already solves various
long standing forge issues.

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 6

Files 10