[BUGFIX] Do not check for pid=-1 when evaluating workspace records
TYPO3 Core handles the result of database queries in a lot of different ways to filter out workspace records. With "versioning support v1" (= without workspaces), the identifier was usually "pid = -1" to filter out records that should not be displayed in live results. With workspaces, there are other, better ways to identify versioned via the following fields: - t3ver_state (what kind of versioned record is there) - t3ver_oid (if the versioned record points to a live record) - t3ver_wsid (the workspace ID) The "pid" field was kept as misuse, but fine for most of the database queries. Since we now have Doctrine DBAL, and Restrictions, the Core API can now be unified to actually check for "t3ver_oid>0" instead of "pid<>-1" to identify a versioned record. All places in TYPO3 Core now does not check for "pid<>-1" anymore for tables that are workspace-aware. In the future, it is then possible to get rid of the "pid=-1" value when writing versioned records, streamlining the API effectively, to find one proper way to query and write records. This change does not modify any other places in TYPO3 Core where Workspace Records are written, but only cleans up the API to only consider "t3ver_oid" instead of "pid", avoiding the mis-use of "pid". Most queries can then be handled by simply checking: - t3ver_wsid=0 AND deleted=0 for only fetching live records - t3ver_wsid IN (0,12) AND t3ver_oid=0 to find all live records, and draft placeholders, to do overlays then Resolves: #89122 Releases: master Change-Id: I781d1ae440fe944e6c8c99d02884a6eb0c1be0a7 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61641 Tested-by:Oliver Hader <oliver.hader@typo3.org> Tested-by:
TYPO3com <noreply@typo3.com> Tested-by:
Susanne Moog <look@susi.dev> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Reviewed-by:
Susanne Moog <look@susi.dev>
Showing
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php 3 additions, 3 deletions...ext/backend/Classes/Controller/EditDocumentController.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php 1 addition, 9 deletions...nd/Classes/Form/FormDataProvider/AbstractItemProvider.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php 5 additions, 4 deletions...asses/Form/FormDataProvider/EvaluateDisplayConditions.php
- typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php 1 addition, 1 deletion...xt/backend/Classes/Tree/Repository/PageTreeRepository.php
- typo3/sysext/backend/Classes/Utility/BackendUtility.php 3 additions, 12 deletionstypo3/sysext/backend/Classes/Utility/BackendUtility.php
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php 2 additions, 2 deletions...t/Form/FormDataProvider/EvaluateDisplayConditionsTest.php
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php 5 additions, 6 deletions...core/Classes/Authentication/BackendUserAuthentication.php
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 1 addition, 1 deletiontypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Classes/DataHandling/PlainDataResolver.php 16 additions, 3 deletionstypo3/sysext/core/Classes/DataHandling/PlainDataResolver.php
- typo3/sysext/core/Classes/Database/Query/Restriction/BackendWorkspaceRestriction.php 3 additions, 3 deletions...atabase/Query/Restriction/BackendWorkspaceRestriction.php
- typo3/sysext/core/Classes/Database/Query/Restriction/FrontendWorkspaceRestriction.php 1 addition, 1 deletion...tabase/Query/Restriction/FrontendWorkspaceRestriction.php
- typo3/sysext/core/Classes/Database/Query/Restriction/WorkspaceRestriction.php 4 additions, 4 deletions...asses/Database/Query/Restriction/WorkspaceRestriction.php
- typo3/sysext/core/Classes/Database/RelationHandler.php 17 additions, 15 deletionstypo3/sysext/core/Classes/Database/RelationHandler.php
- typo3/sysext/core/Classes/Domain/Repository/PageRepository.php 0 additions, 3 deletions.../sysext/core/Classes/Domain/Repository/PageRepository.php
- typo3/sysext/core/Documentation/Changelog/master/Important-89122-UnifiedEvaluationOfVersionedRecordsInWorkspaces.rst 38 additions, 0 deletions...89122-UnifiedEvaluationOfVersionedRecordsInWorkspaces.rst
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/BackendWorkspaceRestrictionTest.php 2 additions, 2 deletions...ase/Query/Restriction/BackendWorkspaceRestrictionTest.php
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendRestrictionContainerTest.php 9 additions, 9 deletions...se/Query/Restriction/FrontendRestrictionContainerTest.php
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php 2 additions, 2 deletions...se/Query/Restriction/FrontendWorkspaceRestrictionTest.php
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/WorkspaceRestrictionTest.php 2 additions, 2 deletions...t/Database/Query/Restriction/WorkspaceRestrictionTest.php
- typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php 2 additions, 1 deletiontypo3/sysext/install/Classes/Updates/PopulatePageSlugs.php
Please register or sign in to comment