summaryrefslogtreecommitdiffstats
path: root/extensions/Voting
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-09-15 16:14:39 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-09-15 16:14:39 +0200
commit61a274e79a4b067f0ef1a81840e7ded39a94efdd (patch)
tree4d07a4f229e869a255cc5dfecd98f5ffef37bc56 /extensions/Voting
parenta4d8243c692870d55bc5353b74e132381588bc0c (diff)
downloadbugzilla-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar.gz
bugzilla-61a274e79a4b067f0ef1a81840e7ded39a94efdd.tar.xz
Bug 686780: Editing votes crashes Bugzilla
r=dkl a=LpSolit
Diffstat (limited to 'extensions/Voting')
-rw-r--r--extensions/Voting/Extension.pm15
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'} = {