summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-08-11 06:34:17 +0200
committermkanat%bugzilla.org <>2009-08-11 06:34:17 +0200
commitea25630305fbd3b55c142c32aab82f9cc7afccfa (patch)
tree1b554df79fe0a83a02075566615552783e9e873b /buglist.cgi
parent918a8c245f8d0d7d0926a015aa9a4940c14ebdd3 (diff)
downloadbugzilla-ea25630305fbd3b55c142c32aab82f9cc7afccfa.tar.gz
bugzilla-ea25630305fbd3b55c142c32aab82f9cc7afccfa.tar.xz
Bug 509045: Make "use_keywords" a global template variable instead of having to pass it to templates all the time
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi13
1 files changed, 8 insertions, 5 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 35d0c0291..47e1f4ba5 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -575,7 +575,10 @@ elsif (($cmdtype eq "doit") && defined $cgi->param('remtype')) {
# exists, add/remove bugs to it, else create it. But if we are
# considering an existing tag, then it has to exist and we throw
# an error if it doesn't (hence the usage of !$is_new_name).
- if (my $old_query = LookupNamedQuery($query_name, undef, LIST_OF_BUGS, !$is_new_name)) {
+ my ($old_query, $query_id) =
+ LookupNamedQuery($query_name, undef, LIST_OF_BUGS, !$is_new_name);
+
+ if ($old_query) {
# We get the encoded query. We need to decode it.
my $old_cgi = new Bugzilla::CGI($old_query);
foreach my $bug_id (split /[\s,]+/, scalar $old_cgi->param('bug_id')) {
@@ -599,9 +602,10 @@ elsif (($cmdtype eq "doit") && defined $cgi->param('remtype')) {
# Only keep bug IDs we want to add/keep. Disregard deleted ones.
my @bug_ids = grep { $bug_ids{$_} == 1 } keys %bug_ids;
# If the list is now empty, we could as well delete it completely.
- ThrowUserError('no_bugs_in_list', {'tag' => $query_name})
- unless scalar(@bug_ids);
-
+ if (!scalar @bug_ids) {
+ ThrowUserError('no_bugs_in_list', {name => $query_name,
+ query_id => $query_id});
+ }
$new_query = "bug_id=" . join(',', sort {$a <=> $b} @bug_ids);
$query_type = LIST_OF_BUGS;
}
@@ -1135,7 +1139,6 @@ if ($dotweak && scalar @bugs) {
object => 'multiple_bugs'});
}
$vars->{'dotweak'} = 1;
- $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
# issue_session_token needs to write to the master DB.
Bugzilla->switch_to_main_db();