From: Frédéric Buclin Date: Thu, 15 Sep 2011 14:14:39 +0000 (+0200) Subject: Bug 686780: Editing votes crashes Bugzilla X-Git-Tag: bugzilla-4.3.1~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61a274e79a4b067f0ef1a81840e7ded39a94efdd;p=thirdparty%2Fbugzilla.git Bug 686780: Editing votes crashes Bugzilla r=dkl a=LpSolit --- diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index 8a786e6597..7a93c672e8 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -52,6 +52,21 @@ use constant REL_VOTER => 4; # Installation # ################ +BEGIN { + *Bugzilla::Bug::votes = \&votes; +} + +sub votes { + my $self = shift; + my $dbh = Bugzilla->dbh; + + return $self->{votes} if exists $self->{votes}; + + $self->{votes} = $dbh->selectrow_array('SELECT votes FROM bugs WHERE bug_id = ?', + undef, $self->id); + return $self->{votes}; +} + sub db_schema_abstract_schema { my ($self, $args) = @_; $args->{'schema'}->{'votes'} = {