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 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 68

  1. Benni Mack commented on patch set 1 04/30/21, 09:15

    Cherry Picked from branch master. The following files contain Git conflicts: * typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
  2. core-ci voted on patch set 1 V -1 04/30/21, 09:16 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10961

  3. Benni Mack uploaded patch set 2 04/30/21, 09:21

  4. Benni Mack marked it ready for review 04/30/21, 09:21

  5. core-ci voted on patch set 2 V +1 04/30/21, 09:34 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10963

  6. Nikita Hovratov voted on patch set 2 V +1 04/30/21, 10:01

  7. Benni Mack voted on patch set 2 V +2 CR +2 04/30/21, 10:32

  8. Benni Mack merged patch set 3 04/30/21, 10:32