From 624a4b0857ad856066f8ae21996ef3bf1c9a5616 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Mon, 11 Jul 2016 19:38:50 +0000
Subject: [PATCH] faq: use iterator

---
 include/staff/faq-categories.inc.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/staff/faq-categories.inc.php b/include/staff/faq-categories.inc.php
index e90f06cd8..4c4848227 100644
--- a/include/staff/faq-categories.inc.php
+++ b/include/staff/faq-categories.inc.php
@@ -140,8 +140,7 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
     }
 } else { //Category Listing.
     $categories = Category::objects()
-        ->annotate(array('faq_count'=>SqlAggregate::COUNT('faqs')))
-        ->all();
+        ->annotate(array('faq_count'=>SqlAggregate::COUNT('faqs')));
 
     if (count($categories)) {
         $categories->sort(function($a) { return $a->getLocalName(); });
-- 
GitLab