diff options
author | mkanat%kerio.com <> | 2006-03-09 08:08:57 +0000 |
---|---|---|
committer | mkanat%kerio.com <> | 2006-03-09 08:08:57 +0000 |
commit | a2eca825a00b33912ec60f797d1112115772ec30 (patch) | |
tree | da4d1e84679afe825f8eb0ef4b1da7d5bc463d67 /process_bug.cgi | |
parent | efacaaf6ee6b79fca5f256bc29c338b9e51e8c5d (diff) | |
download | bugs-a2eca825a00b33912ec60f797d1112115772ec30.tar bugs-a2eca825a00b33912ec60f797d1112115772ec30.tar.gz bugs-a2eca825a00b33912ec60f797d1112115772ec30.tar.bz2 bugs-a2eca825a00b33912ec60f797d1112115772ec30.tar.xz bugs-a2eca825a00b33912ec60f797d1112115772ec30.zip |
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-x | process_bug.cgi | 19 |
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 |