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 --- editkeywords.cgi | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'editkeywords.cgi') diff --git a/editkeywords.cgi b/editkeywords.cgi index 9696480bd..7b906c30b 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -27,6 +27,7 @@ use Bugzilla; use Bugzilla::Constants; use Bugzilla::Util; use Bugzilla::Error; +use Bugzilla::Keyword; my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; @@ -79,17 +80,7 @@ $vars->{'action'} = $action; if ($action eq "") { - my @keywords; - - $vars->{'keywords'} = - $dbh->selectall_arrayref('SELECT keyworddefs.id, keyworddefs.name, - keyworddefs.description, - COUNT(keywords.bug_id) AS bug_count - FROM keyworddefs - LEFT JOIN keywords - ON keyworddefs.id = keywords.keywordid ' . - $dbh->sql_group_by('id', 'name, description') . ' - ORDER BY keyworddefs.name', {'Slice' => {}}); + $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count(); print $cgi->header(); $template->process("admin/keywords/list.html.tmpl", $vars) -- cgit v1.2.3-24-g4f1b