Ignore:
Timestamp:
04/16/09 20:47:17 (15 years ago)
Author:
nanardon
Message:
  • more tests and the fix need to have it passing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Vote/DB/Poll/Results.pm

    r195 r213  
    8181        q{ 
    8282        select count(ballot.id), value from 
    83         (select ballot.id, coalesce(corrected, ballot_map.to, value) as "value" from ballot 
     83        ( 
     84        select NULL as id, label as value from choice where poll = ? 
     85        union 
     86        select ballot.id, coalesce(corrected, ballot_map.to, value) as "value" from ballot 
    8487        } . ($nonull ? '' : ' left ') . q{ 
    8588        join ballot_item 
    8689        on ballot.id = ballot_item.id  
    8790        left join ballot_map on ballot.poll = ballot_map.poll and ballot_map.from = ballot_item.value 
    88         where ballot.poll = ? and (invalid = 'false' or invalid is null) 
     91        where ballot.poll = ? and (invalid = 'false' or invalid is null 
     92        ) 
    8993        group by ballot.id, coalesce(corrected, ballot_map.to, value)) as ballot 
    9094        group by value 
     
    9296        } 
    9397    ); 
    94     $sth->execute($self->voteid); 
     98    $sth->execute($self->voteid, $self->voteid); 
    9599    my @results; 
    96100    while (my $res = $sth->fetchrow_hashref) { 
Note: See TracChangeset for help on using the changeset viewer.