summaryrefslogtreecommitdiffstats
path: root/process_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 /process_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 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi19
1 files changed, 12 insertions, 7 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index c2605afc2..d1efd3825 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -57,6 +57,7 @@ use Bugzilla::User;
use Bugzilla::Util;
use Bugzilla::Field;
use Bugzilla::Product;
+use Bugzilla::Keyword;
# Use the Flag module to modify flag data if the user set flags.
use Bugzilla::Flag;
@@ -82,6 +83,7 @@ my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template;
my $vars = {};
+$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
my $requiremilestone = 0;
@@ -1278,14 +1280,14 @@ if (defined $cgi->param('keywords')) {
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;
}
}
}
@@ -1297,7 +1299,8 @@ if (!grep($keywordaction eq $_, qw(add delete makeexact))) {
if ($::comma eq ""
&& (! @groupAdd) && (! @groupDel)
- && (! @::legal_keywords || (0 == @keywordlist && $keywordaction ne "makeexact"))
+ && (!Bugzilla::Keyword::keyword_count()
+ || (0 == @keywordlist && $keywordaction ne "makeexact"))
&& defined $cgi->param('masscc') && ! $cgi->param('masscc')
) {
if (!defined $cgi->param('comment') || $cgi->param('comment') =~ /^\s*$/) {
@@ -1651,7 +1654,9 @@ foreach my $id (@idlist) {
$bug_changed = 1;
}
- if (@::legal_keywords && defined $cgi->param('keywords')) {
+ if (Bugzilla::Keyword::keyword_count()
+ && defined $cgi->param('keywords'))
+ {
# There are three kinds of "keywordsaction": makeexact, add, delete.
# For makeexact, we delete everything, and then add our things.
# For add, we delete things we're adding (to make sure we don't