Bug #89122

Inconsistent evaluation of pid=-1 with workspace records

Added by Benni Mack 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Workspaces
Start date:
2019-09-11
Due date:
2019-09-11
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Related issues

Follows TYPO3 Core - Bug #89138: Correctly retrieve workspace versions Resolved 2019-09-10

Associated revisions

Revision a6363e85 (diff)
Added by Benni Mack 3 months ago

[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 <>
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61641

#2 Updated by Oliver Hader 3 months ago

  • Due date set to 2019-09-11
  • Start date changed from 2019-09-10 to 2019-09-11
  • Follows Bug #89138: Correctly retrieve workspace versions added

#3 Updated by Gerrit Code Review 3 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61641

#4 Updated by Gerrit Code Review 3 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61641

#5 Updated by Benni Mack 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF