From e77c4379649f29995e58dbccd0a723bf126d991d Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Sun, 27 Dec 2015 17:10:46 -0600 Subject: [PATCH] queue: Fix counts on queues with keywords --- include/ajax.search.php | 3 --- include/class.search.php | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/ajax.search.php b/include/ajax.search.php index 5ab4feeab..2fd01bfe9 100644 --- a/include/ajax.search.php +++ b/include/ajax.search.php @@ -337,12 +337,9 @@ class SearchAjaxAPI extends AjaxController { foreach ($queues as $queue) { $Q = $queue->getBasicQuery(); if (count($Q->extra) || $Q->isWindowed()) { - // Nothing extra in the select clause, or this will break - unset($Q->extra['select']); // XXX: This doesn't work $query->annotate(array( 'q'.$queue->id => $Q->values_flat() - ->filter(array('ticket_id' => new SqlField('ticket_id', 1))) ->aggregate(array('count' => SqlAggregate::COUNT('ticket_id'))) )); } diff --git a/include/class.search.php b/include/class.search.php index 5435c7cd5..a20304018 100644 --- a/include/class.search.php +++ b/include/class.search.php @@ -1163,7 +1163,7 @@ class SavedSearch extends VerySimpleModel { // Consider keyword searching if ($name === ':keywords') { global $ost; - $qs = $ost->searcher->find($value, $qs); + $qs = $ost->searcher->find($value, $qs, false); } else { // XXX: Move getOrmPath to be more of a utility -- GitLab