[BUGFIX] Resolve WS overlays in Extbase JOIN queries properly
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 Resolves: #81208 Resolves: #93484 Releases: master, 10.4 Change-Id: Iaba70be0cf5b7a36ab13380940286628ac976f9a Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68915 Tested-by:Oliver Bartsch <bo@cedev.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Nikita Hovratov <nikita.h@live.de> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Oliver Bartsch <bo@cedev.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Ralf Merz <mail@merzilla.de> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php 152 additions, 80 deletions...se/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml 4 additions, 2 deletions...t/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/category-mm.xml 18 additions, 0 deletions...ase/Tests/Functional/Persistence/Fixtures/category-mm.xml
- typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php 44 additions, 5 deletions...xt/extbase/Tests/Functional/Persistence/WorkspaceTest.php
Please register or sign in to comment