Issue Bug Closed

#89555Querying records in workspaces does not return all proper values due to "pid=-1" database

Benni Mack 10/31/19, 09:38 updated 07/28/20, 20:33

Description

Versioned records have “pid=-1” due to heavy legacy reasons before we had Doctrine DBAL and Restrictions, where one could accidentally query versioned records in their third party extension.

“pid=-1” has several drawbacks on versioned records:
- One could never query results properly by doing SQL queries on versioned records (as only equivalent live records were selected, and then overlaid)
- Unnecessary logic regarding moving and sorting due to versioned records

I propose to migrate to the proper “pid” of the live version, and look at “t3ver_oid” (live record) as all queries in the Core are already work based on this field.

An upgrade wizard then sets the “pid” field properly for all existing versions.

Reviews 12