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.pm

    r209 r213  
    363363        : $self->_register_ballot_clear($choice, $fchoice)) 
    364364        or do { 
    365             self->rollback; 
     365            $self->rollback; 
    366366            return; 
    367367        }; 
     
    380380    $uid ||= Vote::DB::common::gen_uid(); 
    381381    $addb->execute($uid, $self->voteid, scalar(@{$fchoice || []}) ? undef : 'f') or do { 
    382         self->rollback; 
     382        $self->rollback; 
    383383        return; 
    384384    }; 
    385385 
    386386    $self->_register_ballot_items($uid, $choice, $fchoice) or do { 
    387         self->rollback; 
     387        $self->rollback; 
    388388        return; 
    389389    }; 
     
    395395    my ($self, $value) = @_; 
    396396 
    397     my $sth = $self->prepare_cached( 
     397    my $sth = $self->db->prepare_cached( 
    398398        q{select key from choice where lower(label) = ? and poll = ?} 
    399399    ); 
    400     $sth->execute(lc($value), $self->pollid); 
     400    $sth->execute(lc($value), $self->voteid); 
    401401    my $res = $sth->fetchrow_hashref; 
    402402    $sth->finish; 
     
    510510    $self->commit; 
    511511 
    512      
    513512    $uid 
    514513} 
     
    772771    my $sth = $self->db->prepare_cached( 
    773772        q{ 
    774         insert in ballot_map (poll, "from", to) values (?,?,?) 
     773        insert into ballot_map (poll, "from", "to") values (?,?,?) 
    775774        } 
    776775    ); 
     
    786785    $mail =~ s/^\s*//; 
    787786    $mail = lc($mail); 
     787    $id ||= ''; 
    788788    $id =~ s/\s*$//; 
    789789    $id =~ s/^\s//; 
     
    794794    ); 
    795795 
    796     if ($upd->execute($id || '', $mail, $self->voteid) == 0) { 
     796    if ($upd->execute($id, $mail, $self->voteid) == 0) { 
    797797        my $add = $self->db->prepare_cached(q{ 
    798798            insert into voting (poll, label, mail) values (?,?,?) 
Note: See TracChangeset for help on using the changeset viewer.