I have really no clue how the hooks work in Drupal, but it seems to me that the hook_votingapi_results_alter() function has an error which makes it difficult to use it as an example. Here's the proposed fix:

--- votingapi/votingapi.api.php.ori     2010-05-16 20:37:58.000000000 +0200
+++ votingapi/votingapi.api.php 2010-05-16 20:38:07.000000000 +0200
@@ -31,7 +31,7 @@
  *
  * @see votingapi_recalculate_results()
  */
-function hook_votingapi_results_alter(&$results, $content_type, $content_id) {
+function hook_votingapi_results_alter(&$cache, $content_type, $content_id) {
   // We're using a MySQLism (STDDEV isn't ANSI SQL), but it's OK because this is
   // an example. And no one would ever base real code on sample code. Ever. Never.
   

Comments

Pisco’s picture

Status: Active » Reviewed & tested by the community

True, that example is wrong. The proposed change works well with the rest of the example.

eaton’s picture

Committed to the D7 branch, will backport. Thanks!

torotil’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Seems the backport never happened and I don't think I will do. Fixed in 7.x-2.x.