diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-09-15 16:14:39 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-09-15 16:14:39 +0200 |
commit | 61a274e79a4b067f0ef1a81840e7ded39a94efdd (patch) | |
tree | 4d07a4f229e869a255cc5dfecd98f5ffef37bc56 /extensions | |
parent | a4d8243c692870d55bc5353b74e132381588bc0c (diff) | |
download | bugs-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar bugs-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar.gz bugs-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar.bz2 bugs-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar.xz bugs-61a274e79a4b067f0ef1a81840e7ded39a94efdd.zip |
Bug 686780: Editing votes crashes Bugzilla
r=dkl a=LpSolit
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/Voting/Extension.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index 8a786e659..7a93c672e 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'} = { |