[BUGFIX] Extbase Relations are resolved properly in workspaces
Referencing other records in workspaces usually works in a way that it is always pointing to the live pendant of a versioned record, never to the versioned record (t3ver_oid>0). However, for MM this is the exception - because MM does not have the workspace context. So when Extbase is resolving a separate query to resolve e.g. a category from a news record, the MM handling kicks in, but always showed the live version, because there was no chance to overlay. Extbase internally first fetches the aggregate root (e.g. news), then does the overlay and building of the object of the main object, and then fires another query to fetch e.g. all attached categories / relations. In case of MM relations for workspaces, they need to be using the versionedUid of the news record, and not the live version. However, since this also affects other relations (IRRE without MM, Select + Group), the RelationHandler is used for workspace'd relations, and adds one additional query to that. This change adapts the place where the query for the properties is built, and takes the UID of the versioned record to resolve the properties attached to it. Resolves: #88021 Resolves: #82750 Resolves: #82086 Resolves: #76993 Relates: #57169 Releases: master, 10.4 Change-Id: I57d34b46d17d504301f54071404d6169ec974676 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68913 Tested-by:core-ci <typo3@b13.com> Tested-by:
Oliver Bartsch <bo@cedev.de> Tested-by:
Danilo Caccialanza <supercaccia@bluewin.ch> Tested-by:
Martin Tepper <martintepper@arcor.de> Tested-by:
cbugada <christian.bugada@ti.ch> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Oliver Bartsch <bo@cedev.de> Reviewed-by:
Danilo Caccialanza <supercaccia@bluewin.ch> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php 94 additions, 4 deletions...extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
- typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php 1 addition, 2 deletions...xt/extbase/Tests/Functional/Persistence/WorkspaceTest.php
Please register or sign in to comment