From f301c9241af577f8f3df94338f1329d91c82d252 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 1 Jul 2006 23:45:53 +0000 Subject: Bug 343248: SQL query to get all keywords with bug count is duplicated in editkeywords.cgi and describekeywords.cgi Patch By Remi Zara r=mkanat, a=justdave --- describekeywords.cgi | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'describekeywords.cgi') diff --git a/describekeywords.cgi b/describekeywords.cgi index e06350d2e..12c57ea7f 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -27,25 +27,15 @@ use lib "."; use Bugzilla; use Bugzilla::Error; use Bugzilla::User; +use Bugzilla::Keyword; Bugzilla->login(); my $cgi = Bugzilla->cgi; -my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $vars = {}; -my $keywords = $dbh->selectall_arrayref( - q{SELECT keyworddefs.name, keyworddefs.description, - COUNT(keywords.bug_id) AS bugcount - FROM keyworddefs - LEFT JOIN keywords - ON keyworddefs.id = keywords.keywordid } . - $dbh->sql_group_by('keyworddefs.id', - 'keyworddefs.name, keyworddefs.description') . - " ORDER BY keyworddefs.name", {'Slice' => {}}); - -$vars->{'keywords'} = $keywords; +$vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count(); $vars->{'caneditkeywords'} = UserInGroup("editkeywords"); print Bugzilla->cgi->header(); -- cgit v1.2.3-24-g4f1b