Changeset 191
- Timestamp:
- 04/14/09 02:07:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/DB/Poll.pm
r182 r191 336 336 } 337 337 338 sub find_choice_key { 339 my ($self, $value) = @_; 340 341 my $sth = $self->prepare_cached( 342 q{select key from choice where lower(label) = ? and poll = ?} 343 ); 344 $sth->execute(lc($value), $self->pollid); 345 my $res = $sth->fetchrow_hashref; 346 $sth->finish; 347 $res->{key} 348 } 349 338 350 sub _register_ballot_items { 339 351 my ($self, $uid, $choice, $fchoice) = @_; … … 352 364 foreach (@{ $fchoice || []}) { 353 365 $_ or next; 354 $addbc->execute($uid, $_, 'f') or do { 366 my $chkey = $self->find_choice_key($_); 367 $addbc->execute($uid, $_, $chkey ? 't' : 'f') or do { 355 368 $self->db->rollback; 356 369 return;
Note: See TracChangeset
for help on using the changeset viewer.