[livejournal] r20791: LJM-1948: m.livejournal.com Polls: vote ...
Committer: slobin
LJM-1948: m.livejournal.com Polls: vote and view resultsM Poll.pm
U trunk/cgi-bin/LJ/Poll.pm
Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm 2011-12-16 07:50:25 UTC (rev 20790)
+++ trunk/cgi-bin/LJ/Poll.pm 2011-12-16 07:50:32 UTC (rev 20791)
@@ -931,8 +931,6 @@
my $aggr_users;
if (ref $self->{results} eq 'HASH') { # if poll is new and have aggregated results
- $self->{results}{counts} = {};
- $self->{results}{users} = {};
return;
} elsif (not $self->{results}) { # not loaded
my $sth = $self->journal->prepare("SELECT what, value FROM pollresultaggregated2 WHERE pollid=? AND journalid=?");
@@ -1619,7 +1617,7 @@
$self->load_aggregated_results
unless ref $self->{results} && $self->{results}{counts};
-
+
my $results = $qid ? $self->{results}{counts}{$qid} : $self->{results}{counts};
return $results ? %$results : ();
