tac_lite_query_term_access_alter can break views queries.

Created on 26 September 2024, 3 months ago

Problem/Motivation

We encountered an issue with tac_lite_query_term_access_alter in a Views query that includes a non-required relationship to a taxonomy term. The field (taxonomy term reference) that Views joins does not contain any values. When tac_lite_query_term_access_alter joins the tac_td table and applies IN and NOT IN conditions to the query, no results are displayed. This happens because MySQL cannot determine whether a value is not equal to NULL (since NULL represents an unknown value). As a result, the entire condition evaluates to NULL, and rows with NULL values are excluded from the result set. This leads to Views not displaying any results.

Steps to reproduce

While it's difficult to provide clear steps to reproduce the issue, cause I'm not familiar enough with module functionality, I can offer MySQL testing as evidence to support the statement above.

Proposed resolution

Add $or->isNull('tac_td.tid'); to ensure that rows with NULL values are not excluded.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine id.aleks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024