summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-03-09 09:08:57 +0100
committermkanat%kerio.com <>2006-03-09 09:08:57 +0100
commita2eca825a00b33912ec60f797d1112115772ec30 (patch)
treeda4d1e84679afe825f8eb0ef4b1da7d5bc463d67 /post_bug.cgi
parentefacaaf6ee6b79fca5f256bc29c338b9e51e8c5d (diff)
downloadbugzilla-a2eca825a00b33912ec60f797d1112115772ec30.tar.gz
bugzilla-a2eca825a00b33912ec60f797d1112115772ec30.tar.xz
Bug 328638: Remove @::legal_keywords and %::keywordsbyname
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi12
1 files changed, 7 insertions, 5 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 3e589ebe8..de8063543 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -34,6 +34,7 @@ use Bugzilla::Bug;
use Bugzilla::User;
use Bugzilla::Field;
use Bugzilla::Product;
+use Bugzilla::Keyword;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
@@ -273,14 +274,14 @@ if ($cgi->param('keywords') && UserInGroup("editbugs")) {
if ($keyword eq '') {
next;
}
- my $i = GetKeywordIdFromName($keyword);
- if (!$i) {
+ my $keyword_obj = new Bugzilla::Keyword({name => $keyword});
+ if (!$keyword_obj) {
ThrowUserError("unknown_keyword",
{ keyword => $keyword });
}
- if (!$keywordseen{$i}) {
- push(@keywordlist, $i);
- $keywordseen{$i} = 1;
+ if (!$keywordseen{$keyword_obj->id}) {
+ push(@keywordlist, $keyword_obj->id);
+ $keywordseen{$keyword_obj->id} = 1;
}
}
}
@@ -518,6 +519,7 @@ if ($cgi->cookie("BUGLIST")) {
@bug_list = split(/:/, $cgi->cookie("BUGLIST"));
}
$vars->{'bug_list'} = \@bug_list;
+$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
print $cgi->header();
$template->process("bug/create/created.html.tmpl", $vars)