From: lpsolit%gmail.com <> Date: Mon, 19 Jun 2006 06:11:59 +0000 (+0000) Subject: Bug 341924: When viewing several bugs at once using show_bug.cgi?format=multiple... X-Git-Tag: bugzilla-2.23.2~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccec3de0ed12a612343915b8c5fd2d903cca0408;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/show_bug.cgi b/show_bug.cgi index 36e3250577..578b6a7a88 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 573a587b64..50875382d7 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 9244592d82..023cb95732 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 %] +