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