From ccec3de0ed12a612343915b8c5fd2d903cca0408 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 19 Jun 2006 06:11:59 +0000 Subject: Bug 341924: When viewing several bugs at once using show_bug.cgi?format=multiple, invalid bugs should generate an error message - Patch by Frédéric Buclin r=timeless a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- show_bug.cgi | 8 ++++++-- skins/standard/show_multiple.css | 5 +++++ template/en/default/bug/show-multiple.html.tmpl | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/show_bug.cgi b/show_bug.cgi index 36e325057..578b6a7a8 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -78,8 +78,12 @@ if ($single) { } } else { foreach my $id ($cgi->param('id')) { - my $bug = new Bugzilla::Bug($id, Bugzilla->user->id); - push @bugs, $bug; + # Be kind enough and accept URLs of the form: id=1,2,3. + my @ids = split(/,/, $id); + foreach (@ids) { + my $bug = new Bugzilla::Bug($_, Bugzilla->user->id); + push(@bugs, $bug); + } } } diff --git a/skins/standard/show_multiple.css b/skins/standard/show_multiple.css index 573a587b6..50875382d 100644 --- a/skins/standard/show_multiple.css +++ b/skins/standard/show_multiple.css @@ -45,3 +45,8 @@ h1 { .bugfields table.timetracking th, .bugfields table.timetracking td { width: 10em; } + +.error { + color: red; + font-weight: bold; +} diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 9244592d8..023cb9573 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -59,6 +59,22 @@ + [% IF bug.error %] + + + + [% ELSE %] [%# The rightcell block (also called by the row block) automatically shows # the fields from rightcells %] [% rightcells = ['reporter', 'assigned_to'] %] @@ -237,6 +253,7 @@ [% END %] + [% END %]
+ [% IF bug.error == "InvalidBugId" %] + '[%+ bug.bug_id FILTER html %]' is not a valid [% terms.bug %] number + [%- IF Param("usebugaliases") %] nor a known [% terms.bug %] alias[% END %]. + [% ELSIF bug.error == "NotPermitted" %] + You are not allowed to view this [% terms.bug %]. + [% ELSIF bug.error == "NotFound" %] + This [% terms.bug %] cannot be found. + [% ELSE %] + [%+ bug.error FILTER html %] + [% END %] +
-- cgit v1.2.3-24-g4f1b