Commit ccec3de0 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 341924: When viewing several bugs at once using…

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 <LpSolit@gmail.com> r=timeless a=myk
parent 7649fcfd
...@@ -78,8 +78,12 @@ if ($single) { ...@@ -78,8 +78,12 @@ if ($single) {
} }
} else { } else {
foreach my $id ($cgi->param('id')) { foreach my $id ($cgi->param('id')) {
my $bug = new Bugzilla::Bug($id, Bugzilla->user->id); # Be kind enough and accept URLs of the form: id=1,2,3.
push @bugs, $bug; my @ids = split(/,/, $id);
foreach (@ids) {
my $bug = new Bugzilla::Bug($_, Bugzilla->user->id);
push(@bugs, $bug);
}
} }
} }
......
...@@ -45,3 +45,8 @@ h1 { ...@@ -45,3 +45,8 @@ h1 {
.bugfields table.timetracking th, .bugfields table.timetracking td { .bugfields table.timetracking th, .bugfields table.timetracking td {
width: 10em; width: 10em;
} }
.error {
color: red;
font-weight: bold;
}
...@@ -59,6 +59,22 @@ ...@@ -59,6 +59,22 @@
</h1> </h1>
<table class="bugfields"> <table class="bugfields">
[% IF bug.error %]
<tr>
<td class="error">
[% 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 %]
</td>
</tr>
[% ELSE %]
[%# The rightcell block (also called by the row block) automatically shows [%# The rightcell block (also called by the row block) automatically shows
# the fields from rightcells %] # the fields from rightcells %]
[% rightcells = ['reporter', 'assigned_to'] %] [% rightcells = ['reporter', 'assigned_to'] %]
...@@ -237,6 +253,7 @@ ...@@ -237,6 +253,7 @@
</td> </td>
</tr> </tr>
[% END %] [% END %]
[% END %]
</table> </table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment