Skip to content

[DQT] Fix visit list filtering in candidate matching#10438

Open
HenriRabalais wants to merge 3 commits intoaces:mainfrom
HenriRabalais:2026-04-03_dqt-visit-filter-fix
Open

[DQT] Fix visit list filtering in candidate matching#10438
HenriRabalais wants to merge 3 commits intoaces:mainfrom
HenriRabalais:2026-04-03_dqt-visit-filter-fix

Conversation

@HenriRabalais
Copy link
Copy Markdown
Collaborator

@HenriRabalais HenriRabalais commented Apr 3, 2026

Description

Fixes a bug where DQT filters did not apply visit list criteria when matching candidates. The getCandidateMatches() method was not passing the $visitlist parameter to buildQueryFromCriteria(), and the visit filtering logic in buildQueryFromCriteria() was incorrectly adding a duplicate session table join.

Changes

  • src/Data/Query/SQLQueryEngine.php:
    • Pass $visitlist parameter to buildQueryFromCriteria() in getCandidateMatches() method
    • Remove duplicate session table join from buildQueryFromCriteria() - the session table is already joined by getFieldNameFromDict() when querying session-scoped fields
  • modules/dataquery/php/query.class.inc: Remove FIXME comment and simplify visit list assignment since functionality is now verified

Testing Instructions

  1. Navigate to the Data Query Tool
  2. Select fields with session scope
  3. Add a filter on a parameter and select only a subset of visits (e.g., only "V1" and "V2")
  4. Run the query
  5. Verify that results only include data from the specified visits
  6. Compare with results when all visits are selected - should see different candidate counts

Related Issues

Resolves #10435

@HenriRabalais HenriRabalais requested a review from driusan April 3, 2026 10:49
@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Module: dataquery PR or issue related to (new) dataquery module labels Apr 3, 2026
@HenriRabalais HenriRabalais marked this pull request as draft April 3, 2026 11:04
@HenriRabalais HenriRabalais marked this pull request as ready for review April 3, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code Module: dataquery PR or issue related to (new) dataquery module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DQT] filters do not add visit list criteria when matching to candidate.

1 participant