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 :)

Comments

greggles’s picture

Status: Active » Needs review
StatusFileSize
new889 bytes

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

greggles’s picture

I just ran into this again. The patch still applies cleanly to 6.x-2.x.

eaton’s picture

Status: Needs review » Fixed

I've applied this to the D7 branch and will backport to D6. Thanks!

greggles’s picture

Status: Fixed » Patch (to be ported)

Awesome, thanks!

For my own tracking I'd like to keep this in an open state until it's in the 6.x branch.

eaton’s picture

Status: Patch (to be ported) » Closed (fixed)

Committed to the 6.x branch -- I still need to do some testing to ensure none of the backported code causes problems. Once I'm comfortable with that I'll roll a new 6.x release. Thanks again!