Report filters for grade and pending suggestions return nothing when combined
Problem/Motivation
On the report, "Effective grade" and "Pending suggestions" give no rows when both are set. With ai_disclosure_effective_grade=ai_deepfake&ai_disclosure_pending_suggestions=1 the list is empty, though one deep fake item has a pending suggestion. Each filter works alone.
Both filters build their own subquery and pass its arguments to addWhereExpression(). The automatic placeholder names of the two subqueries are the same, so the second set replaces the first.
Steps to reproduce
- Give a deep fake item a pending suggestion.
- Open the report with both filters above set.
Proposed resolution
Add each subquery as a correlated EXISTS condition, so the query builder names the placeholders.
Acceptance criteria
- A test with both filters set returns the item.
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.
Edited by Giorgio Alfredo Pagano