Trash breaks revision-based views and relation queries

Created on 10 October 2023, about 1 year ago
Updated 28 October 2023, about 1 year ago

Problem/Motivation

ViewsQueryAlter adds a condition for the "deleted" field, but assumes the entity's base table is always present. This leads to a broken query for Views based on revisions.

Steps to reproduce

Have Trash and Views enabled.
Enable Trash module for Nodes.
Create a new View based on Node Revision and save it.
The view will crash with a broken query due to the "node_field_data" table not being included in the query.

Proposed resolution

Join in the base table before adding the condition.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden twod Sweden

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024