Review 10.4 Merged

68935[BUGFIX] Resolve WS overlays in Extbase JOIN queries properly

Benni Mack CR +2 V +2 Hard +219 −87 updated 04/30/21, 10:32

Commit message

When having JOINs in SQL selects, which typically happens
when a MM property is resolved via Extbase's ORM, versionOL()
threw an SQL error because versionOL() also queried "uid_local"
which did not exist in e.g. sys_category.

This change splits up the massive "overlayLanguageAndWorkspace()"
method into smaller chunks and takes a different route when
doing workspace overlays for JOINs. By re-fetching the main tables'
record, all known fields can be identified via array_key_intersect()
and then chunked together again with the JOINed information
via array_replace().

The added tests show that the assertion for MM relations now work
(if the fix is not applied, the included tests fail due to a SQL error in tests),
but deliver a wrong result, which will be fixed with
https://review.typo3.org/c/Packages/TYPO3.CMS/+/68913

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 4