votingapi_set_votes() works fine when passing in an array of votes, but handling a single submission seems to be broken. The check for a single vote seems to be reversed. Adding a ! fixes the problem.

Index: votingapi.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/votingapi/votingapi.module,v
retrieving revision 1.46.2.1
diff -u -r1.46.2.1 votingapi.module
--- votingapi.module	18 Nov 2007 07:46:51 -0000	1.46.2.1
+++ votingapi.module	14 Jan 2008 21:28:12 -0000
@@ -131,7 +131,7 @@
  */
 function votingapi_set_votes($votes = array(), $criteria = NULL) {
   $touched = array();
-  if (empty($votes['content_type'])) {
+  if (!empty($votes['content_type'])) {
     $votes = array($votes);
   }
 
CommentFileSizeAuthor
#1 votingapi_votes_array.patch918 bytesquicksketch

Comments

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new918 bytes

Looks like this patch was fixed but the same problem still exists for votingapi_add_votes() and votingapi_add_results(). The current CVS HEAD of Fivestar is now fully functional if you're looking for a module to test ;)

quicksketch’s picture

Status: Needs review » Fixed

Eaton's already handled this one in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.