diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-09-29 01:25:47 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-09-29 01:25:47 +0200 |
commit | dd832b2728550c696a324d74a3a0013e87d8f5c8 (patch) | |
tree | 0e0e704c1f7d21f4d65d8b11525d55daf95edf80 | |
parent | 36478e4ed9e8b3f1e613a0829e4ee9f54c1f8f40 (diff) | |
download | bugzilla-dd832b2728550c696a324d74a3a0013e87d8f5c8.tar.gz bugzilla-dd832b2728550c696a324d74a3a0013e87d8f5c8.tar.xz |
Bug 686786: Decreasing votestoconfirm in editproducts.cgi crashes Bugzilla
r/a=mkanat
-rw-r--r-- | Bugzilla/Object.pm | 2 | ||||
-rw-r--r-- | Bugzilla/Product.pm | 4 | ||||
-rw-r--r-- | extensions/Voting/Extension.pm | 8 | ||||
-rw-r--r-- | extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl | 14 | ||||
-rw-r--r-- | template/en/default/admin/products/groupcontrol/updated.html.tmpl | 8 |
5 files changed, 19 insertions, 17 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 1cad3e829..29a6415b9 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -441,6 +441,8 @@ sub audit_log { # During update, it's the actual %changes hash produced by update(). foreach my $field (keys %$changes) { + # Skip private changes. + next if $field =~ /^_/; my ($from, $to) = @{ $changes->{$field} }; $sth->execute($user_id, $class, $self->id, $field, $from, $to); } diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 64a146be9..486d177c7 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -223,7 +223,7 @@ sub update { $new_setting->{group}->name, Bugzilla->user->id, $timestamp); } - push(@{$changes->{'group_controls'}->{'now_mandatory'}}, + push(@{$changes->{'_group_controls'}->{'now_mandatory'}}, {name => $new_setting->{group}->name, bug_count => scalar @$bug_ids}); } @@ -248,7 +248,7 @@ sub update { $old_setting->{group}->name, '', Bugzilla->user->id, $timestamp); } - push(@{$changes->{'group_controls'}->{'now_na'}}, + push(@{$changes->{'_group_controls'}->{'now_na'}}, {name => $old_setting->{group}->name, bug_count => scalar @$bug_ids}); } diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index 7a93c672e..6a90176ec 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -678,7 +678,7 @@ sub _modify_bug_votes { } } - $changes->{'too_many_votes'} = \@toomanyvotes_list; + $changes->{'_too_many_votes'} = \@toomanyvotes_list; # 2. too many total votes for a single user. # This part doesn't work in the general case because _remove_votes @@ -725,7 +725,7 @@ sub _modify_bug_votes { } } - $changes->{'too_many_total_votes'} = \@toomanytotalvotes_list; + $changes->{'_too_many_total_votes'} = \@toomanytotalvotes_list; # 3. enough votes to confirm my $bug_list = $dbh->selectcol_arrayref( @@ -738,7 +738,7 @@ sub _modify_bug_votes { my $confirmed = _confirm_if_vote_confirmed($bug_id); push (@updated_bugs, $bug_id) if $confirmed; } - $changes->{'confirmed_bugs'} = \@updated_bugs; + $changes->{'_confirmed_bugs'} = \@updated_bugs; # Now that changes are done, we can send emails to voters. foreach my $msg (@msgs) { @@ -748,7 +748,7 @@ sub _modify_bug_votes { foreach my $bug_id (@updated_bugs) { my $sent_bugmail = Bugzilla::BugMail::Send( $bug_id, { changer => Bugzilla->user }); - $changes->{'confirmed_bugs_sent_bugmail'}->{$bug_id} = $sent_bugmail; + $changes->{'_confirmed_bugs_sent_bugmail'}->{$bug_id} = $sent_bugmail; } } diff --git a/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl index af2b1c102..15fb1efe0 100644 --- a/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl +++ b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl @@ -56,8 +56,8 @@ <p>Checking existing votes in this product for anybody who now has too many votes for [% terms.abug %]...<br> - [% IF changes.too_many_votes.size %] - [% FOREACH detail = changes.too_many_votes %] + [% IF changes._too_many_votes.size %] + [% FOREACH detail = changes._too_many_votes %] →removed votes for [% terms.bug %] <a href="show_bug.cgi?id= [%- detail.id FILTER uri %]"> [%- detail.id FILTER html %]</a> from [% detail.name FILTER html %]<br> @@ -69,8 +69,8 @@ <p>Checking existing votes in this product for anybody who now has too many total votes...<br> - [% IF changes.too_many_total_votes.size %] - [% FOREACH detail = changes.too_many_total_votes %] + [% IF changes._too_many_total_votes.size %] + [% FOREACH detail = changes._too_many_total_votes %] →removed votes for [% terms.bug %] <a href="show_bug.cgi?id= [%- detail.id FILTER uri %]"> [%- detail.id FILTER html %]</a> from [% detail.name FILTER html %]<br> @@ -82,15 +82,15 @@ <p>Checking unconfirmed [% terms.bugs %] in this product for any which now have sufficient votes...<br> - [% IF changes.confirmed_bugs.size %] - [% FOREACH id = changes.confirmed_bugs %] + [% IF changes._confirmed_bugs.size %] + [% FOREACH id = changes._confirmed_bugs %] [%# This is INCLUDED instead of PROCESSED to avoid variables getting overwritten, which happens otherwise %] [% INCLUDE bug/process/results.html.tmpl type = 'votes' header_done = 1 - sent_bugmail = changes.confirmed_bugs_sent_bugmail.$id + sent_bugmail = changes._confirmed_bugs_sent_bugmail.$id id = id %] [% END %] diff --git a/template/en/default/admin/products/groupcontrol/updated.html.tmpl b/template/en/default/admin/products/groupcontrol/updated.html.tmpl index 2f59cae68..353ce5c75 100644 --- a/template/en/default/admin/products/groupcontrol/updated.html.tmpl +++ b/template/en/default/admin/products/groupcontrol/updated.html.tmpl @@ -27,16 +27,16 @@ title = title %] <p> -[% IF changes.group_controls.now_na.size %] - [% FOREACH g = changes.group_controls.now_na %] +[% IF changes._group_controls.now_na.size %] + [% FOREACH g = changes._group_controls.now_na %] Removing [% terms.bugs %] from group '[% g.name FILTER html %]' which no longer applies to this product<p> [% g.bug_count FILTER html %] [%+ terms.bugs %] removed<p> [% END %] [% END %] -[% IF changes.group_controls.now_mandatory.size %] - [% FOREACH g = changes.group_controls.now_mandatory %] +[% IF changes._group_controls.now_mandatory.size %] + [% FOREACH g = changes._group_controls.now_mandatory %] Adding [% terms.bugs %] to group '[% g.name FILTER html %]' which is mandatory for this product<p> [% g.bug_count FILTER html %] [%+ terms.bugs %] added<p> |