summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-09-15 16:16:54 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-09-15 16:16:54 +0200
commit6721e79f654fe64a247525fec35e217d4fcf57e2 (patch)
tree49196a566d397516e8d37f5b27b0380109104c6e /extensions
parent6fa9b5eafed50fe693238c83a04797e2042e27cb (diff)
downloadbugzilla-6721e79f654fe64a247525fec35e217d4fcf57e2.tar.gz
bugzilla-6721e79f654fe64a247525fec35e217d4fcf57e2.tar.xz
Bug 686780: Editing votes crashes Bugzilla
r=dkl a=LpSolit
Diffstat (limited to 'extensions')
-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'} = {