From: mkanat%bugzilla.org <> Date: Wed, 12 Aug 2009 01:42:32 +0000 (+0000) Subject: Bug 509108: Don't require a bug_list parameter to show the bug template (create the... X-Git-Tag: bugzilla-3.5.1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf68d5918c2eea9b123ee36c7f3541cc1154e060;p=thirdparty%2Fbugzilla.git Bug 509108: Don't require a bug_list parameter to show the bug template (create the last_bug_list global template parameter) Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 22ea4b7ccb..d897cd946a 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -756,7 +756,15 @@ sub create { # Whether or not keywords are enabled, in this Bugzilla. 'use_keywords' => sub { return Bugzilla::Keyword->any_exist; }, - + + 'last_bug_list' => sub { + my @bug_list; + my $cgi = Bugzilla->cgi; + if ($cgi->cookie("BUGLIST")) { + @bug_list = split(/:/, $cgi->cookie("BUGLIST")); + } + return \@bug_list; + }, # These don't work as normal constants. DB_MODULE => \&Bugzilla::Constants::DB_MODULE, diff --git a/post_bug.cgi b/post_bug.cgi index c6e4006e04..f3b31e9a8d 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -274,12 +274,6 @@ foreach my $i (@{$bug->dependson || []}, @{$bug->blocked || []}) { push (@{$vars->{'sentmail'}}, { type => 'dep', id => $i, }); } -my @bug_list; -if ($cgi->cookie("BUGLIST")) { - @bug_list = split(/:/, $cgi->cookie("BUGLIST")); -} -$vars->{'bug_list'} = \@bug_list; - if ($token) { trick_taint($token); $dbh->do('UPDATE tokens SET eventdata = ? WHERE token = ?', undef, diff --git a/process_bug.cgi b/process_bug.cgi index 85e6c60fc6..c46dd6fb52 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -202,7 +202,6 @@ $vars->{'title_tag'} = "bug_processed"; my @bug_list; if ($cgi->cookie("BUGLIST")) { @bug_list = split(/:/, $cgi->cookie("BUGLIST")); - $vars->{'bug_list'} = \@bug_list; } my ($action, $next_bug); diff --git a/show_bug.cgi b/show_bug.cgi index c0e5432348..4a530269e7 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -103,14 +103,6 @@ $vars->{'marks'} = \%marks; my @bugids = map {$_->bug_id} grep {!$_->error} @bugs; $vars->{'bugids'} = join(", ", @bugids); -# Next bug in list (if there is one) -my @bug_list; -if ($cgi->cookie("BUGLIST")) { - @bug_list = split(/:/, $cgi->cookie("BUGLIST")); -} - -$vars->{'bug_list'} = \@bug_list; - # Work out which fields we are displaying (currently XML only.) # If no explicit list is defined, we show all fields. We then exclude any # on the exclusion list. This is so you can say e.g. "Everything except diff --git a/template/en/default/bug/create/created.html.tmpl b/template/en/default/bug/create/created.html.tmpl index 0a03a4d710..dd1be1c178 100644 --- a/template/en/default/bug/create/created.html.tmpl +++ b/template/en/default/bug/create/created.html.tmpl @@ -28,8 +28,6 @@ # this contents, see template bug/process/bugmail.html.tmpl # bug: object; Bugzilla::Bug object of the bug that was created (used in # template bug/edit.html.tmpl - # bug_list: array of integers; sorted bug list (used in template - # bug/navigate.html.tmpl) #%] [% PROCESS global/variables.none.tmpl %] diff --git a/template/en/default/bug/navigate.html.tmpl b/template/en/default/bug/navigate.html.tmpl index 7b8f3c8274..9592301f71 100644 --- a/template/en/default/bug/navigate.html.tmpl +++ b/template/en/default/bug/navigate.html.tmpl @@ -36,30 +36,32 @@