Describe the bug
When a filter is added to the dqt, the list of visits is not added to the filtering criteria.
To Reproduce
Steps to reproduce the behavior (attach screenshots if applicable):
- Go to the dqt
- Select a set of fields
- Add a filter on a parameter with a subset of the visit
- Run query and see results
What did you expect to happen?
The results should be filter for data that matches the filter criteria only for the visits specified
Source of error
- the bug has been located and is related to the following code:
|
// FIXME: Verify visits, test was done with candidate scope data |
|
$visitlist = null; |
|
if (isset($crit['visits'])) { |
|
$visitlist = $crit['visits']; |
|
} |
|
|
|
\Profiler::checkpoint("Calling engine get matches"); |
|
$matches = $engine->getCandidateMatches($term, $visitlist); |
- as within the
getCandidateMatches definition, the $visitList is never used
|
public function getCandidateMatches( |
|
\LORIS\Data\Query\QueryTerm $term, |
|
?array $visitlist = null |
|
) : iterable { |
|
$this->resetEngineState(); |
|
$this->addTable('candidate c'); |
|
$this->addWhereClause("c.Active='Y'"); |
|
$prepbindings = []; |
|
|
|
$this->buildQueryFromCriteria($term, $prepbindings); |
|
|
|
$query = 'SELECT DISTINCT c.CandID FROM'; |
|
|
|
$query .= ' ' . $this->getTableJoins(); |
|
|
|
$query .= ' WHERE '; |
|
$query .= $this->getWhereConditions(); |
|
$query .= ' ORDER BY c.CandID'; |
|
|
|
$DB = $this->loris->getDatabaseConnection(); |
|
$rows = $DB->pselectCol($query, $prepbindings); |
|
foreach ($rows as $candID) { |
|
yield new CandID(strval($candID)); |
|
} |
|
} |
Describe the bug
When a filter is added to the dqt, the list of visits is not added to the filtering criteria.
To Reproduce
Steps to reproduce the behavior (attach screenshots if applicable):
What did you expect to happen?
The results should be filter for data that matches the filter criteria only for the visits specified
Source of error
Loris/modules/dataquery/php/query.class.inc
Lines 764 to 771 in af14bec
getCandidateMatchesdefinition, the$visitListis never usedLoris/src/Data/Query/SQLQueryEngine.php
Lines 110 to 134 in 61fb08b