Changing several bugs at once crashes if the user wants to automatically redisplay the bug he changed

RESOLVED FIXED in Bugzilla 2.22

Status

()

Bugzilla
Creating/Changing Bugs
--
critical
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Frédéric Buclin, Assigned: glob)

Tracking

2.21
Bugzilla 2.22
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

v2
725 bytes, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
If the preference is set to automatically redisplay the bug the user has
changed, changing several bugs at once makes Bugzilla to crash, because more
than one bug is concerned and Bugzilla doesn't know which bug to redisplay:

invalid number of arguments (0)() at Bugzilla/Bug.pm line 122
	Bugzilla::Bug::new('Bugzilla::Bug', 1) called at
/var/www/html/cvsbugzilla/process_bug.cgi line 1852


The corresponding line in process_bug.cgi is:

} elsif ($action eq 'same_bug') {
    my $bug = new Bugzilla::Bug($cgi->param('id'), $whoid);

The problem is that $cgi->param('id') is undefined when changing several bugs at
once.
(Reporter)

Updated

12 years ago
Target Milestone: --- → Bugzilla 2.22
(Assignee)

Comment 1

12 years ago
Created attachment 189895 [details] [diff] [review]
v1
Assignee: create-and-change → bugzilla
Status: NEW → ASSIGNED
Attachment #189895 - Flags: review?(LpSolit)
(Reporter)

Comment 2

12 years ago
Comment on attachment 189895 [details] [diff] [review]
v1


>+if (scalar @idlist == 1) {
>+    $action = Bugzilla->user->settings->{'post_bug_submit_action'}->{'value'};
>+} else {
>+    $action = 'nothing';
>+}

If you click "Change several bugs at once" but select only one bug, @idlist
contains only one element but $cgi->param('id') remains undefined and Bugzilla
still crashes.

What you have to test is (defined $cgi->param('id')).
Attachment #189895 - Flags: review?(LpSolit) → review-
(Reporter)

Comment 3

12 years ago
glob, ping?

Could you please update your patch? The modification is trivial. This would
avoid us to crash everytime we change several bugs at once. :(
(Assignee)

Comment 4

12 years ago
Created attachment 190652 [details] [diff] [review]
v2

oops, sorry lpsolit; things are pretty insane for me currently.
Attachment #189895 - Attachment is obsolete: true
(Assignee)

Updated

12 years ago
Attachment #190652 - Flags: review?
(Reporter)

Comment 5

12 years ago
Comment on attachment 190652 [details] [diff] [review]
v2

I'm surprised that the "Bug processed" page displays "No search results
available" despite of we just edited a bug list! But that's another bug.

r=LpSolit
Attachment #190652 - Flags: review? → review+
(Reporter)

Updated

12 years ago
Flags: approval?
Seems like we should do something more than nothing in this situation, but in
the meantime we certainly shouldn't crash.
Flags: approval? → approval+
(Reporter)

Comment 7

12 years ago
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.269; previous revision: 1.268
done
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.