summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-10-10 13:11:24 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-10-10 13:11:24 -0400
commit56bbd4ba0165c8c8f902ee6ebde66a4d5fdfb1a0 (patch)
tree6fa6f12aa10712f58f0ddcb0e97ecf28a374c58e /modules
parente105186172a34f4c3ba05af594e34dfa63083b72 (diff)
downloadbrdo-56bbd4ba0165c8c8f902ee6ebde66a4d5fdfb1a0.tar.gz
brdo-56bbd4ba0165c8c8f902ee6ebde66a4d5fdfb1a0.tar.bz2
Issue #2017433 by LinL, BarisW, coredumperror: The documentation for hook_ranking() is wrong
Diffstat (limited to 'modules')
-rw-r--r--modules/node/node.api.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index 9a4d09591..95c77f3f4 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -950,7 +950,7 @@ function hook_node_info() {
* 'recent', or 'comments'. The values should be arrays themselves, with the
* following keys available:
* - title: (required) The human readable name of the ranking mechanism.
- * - join: (optional) The part of a query string to join to any additional
+ * - join: (optional) An array with information to join any additional
* necessary table. This is not necessary if the table required is already
* joined to by the base query, such as for the {node} table. Other tables
* should use the full table name as an alias to avoid naming collisions.
@@ -974,7 +974,12 @@ function hook_ranking() {
'title' => t('Average vote'),
// Note that we use i.sid, the search index's search item id, rather than
// n.nid.
- 'join' => 'LEFT JOIN {vote_node_data} vote_node_data ON vote_node_data.nid = i.sid',
+ 'join' => array(
+ 'type' => 'LEFT',
+ 'table' => 'vote_node_data',
+ 'alias' => 'vote_node_data',
+ 'on' => 'vote_node_data.nid = i.sid',
+ ),
// The highest possible score should be 1, and the lowest possible score,
// always 0, should be 0.
'score' => 'vote_node_data.average / CAST(%f AS DECIMAL)',