From dd832b2728550c696a324d74a3a0013e87d8f5c8 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 29 Sep 2011 01:25:47 +0200 Subject: Bug 686786: Decreasing votestoconfirm in editproducts.cgi crashes Bugzilla r/a=mkanat --- extensions/Voting/Extension.pm | 8 ++++---- .../default/hook/admin/products/updated-changes.html.tmpl | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'extensions') 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 @@

Checking existing votes in this product for anybody who now has too many votes for [% terms.abug %]...
- [% 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 %] [%- detail.id FILTER html %] from [% detail.name FILTER html %]
@@ -69,8 +69,8 @@

Checking existing votes in this product for anybody who now has too many total votes...
- [% 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 %] [%- detail.id FILTER html %] from [% detail.name FILTER html %]
@@ -82,15 +82,15 @@

Checking unconfirmed [% terms.bugs %] in this product for any which now have sufficient votes...
- [% 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 %] -- cgit v1.2.3-24-g4f1b