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
Comment #1
Pisco commentedTrue, that example is wrong. The proposed change works well with the rest of the example.
Comment #2
eaton commentedCommitted to the D7 branch, will backport. Thanks!
Comment #3
torotil commentedSeems the backport never happened and I don't think I will do. Fixed in 7.x-2.x.