Skip to content

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

@HenriRabalais

Description

@HenriRabalais

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):

  1. Go to the dqt
  2. Select a set of fields
  3. Add a filter on a parameter with a subset of the visit
  4. 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));
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions