calling votingapi_select_single_result_value with no criteria makes it easy to shoot self in foot

greggles - September 29, 2009 - 12:02
Project:Voting API
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

If you call that with no criteria then votingAPI will graciously return all the rows in the table to you and use PHP to select the top one.

I'm not sure exactly how, but we should ideally make that not happen :)

#1

greggles - September 29, 2009 - 13:53
Status:active» needs review

_votingapi_select allows a $limit to be specified.

My suggestion is that we use the $limit parameter of votingapi_select_results which gets passed along to _votingapi_select so that votingapi_select_single_result_value will only select a single value.

AttachmentSize
591044_votingapi_single_result_really_single.patch 889 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.