From 216453f382d317892574cb57e3e9a29cf7393d98 Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Thu, 14 Feb 2019 14:51:10 -0600
Subject: [PATCH] Issue: Duplicate Tickets in Closed Queue

When going to my closed queue, I had the same ticket showing multiple times. This commit moves the call to the distinct method outside of any if statements so that the tickets will always be grouped by their id.
---
 include/staff/templates/queue-tickets.tmpl.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/staff/templates/queue-tickets.tmpl.php b/include/staff/templates/queue-tickets.tmpl.php
index dba05dea8..d6e6307c1 100644
--- a/include/staff/templates/queue-tickets.tmpl.php
+++ b/include/staff/templates/queue-tickets.tmpl.php
@@ -90,9 +90,9 @@ if (isset($tickets->extra['tables'])) {
             $criteria->values_flat('ticket_id')]);
     # Index hint should be used on the $criteria query only
     $tickets->clearOption(QuerySet::OPT_INDEX_HINT);
-    $tickets->distinct('ticket_id');
 }
 
+$tickets->distinct('ticket_id');
 $count = $queue->getCount($thisstaff) ?: (PAGE_LIMIT*3);
 $pageNav->setTotal($count, true);
 $pageNav->setURL('tickets.php', $args);
-- 
GitLab