diff options
author | mkanat%kerio.com <> | 2006-03-09 09:08:57 +0100 |
---|---|---|
committer | mkanat%kerio.com <> | 2006-03-09 09:08:57 +0100 |
commit | a2eca825a00b33912ec60f797d1112115772ec30 (patch) | |
tree | da4d1e84679afe825f8eb0ef4b1da7d5bc463d67 /post_bug.cgi | |
parent | efacaaf6ee6b79fca5f256bc29c338b9e51e8c5d (diff) | |
download | bugzilla-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-x | post_bug.cgi | 12 |
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) |