Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443915
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443915
Commits
56bbd4ba
Commit
56bbd4ba
authored
9 years ago
by
David Rothstein
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2017433
by LinL, BarisW, coredumperror: The documentation for hook_ranking() is wrong
parent
e1051861
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/node/node.api.php
+7
-2
7 additions, 2 deletions
modules/node/node.api.php
with
7 additions
and
2 deletions
modules/node/node.api.php
+
7
−
2
View file @
56bbd4ba
...
@@ -950,7 +950,7 @@ function hook_node_info() {
...
@@ -950,7 +950,7 @@ function hook_node_info() {
* 'recent', or 'comments'. The values should be arrays themselves, with the
* 'recent', or 'comments'. The values should be arrays themselves, with the
* following keys available:
* following keys available:
* - title: (required) The human readable name of the ranking mechanism.
* - 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
* 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
* 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.
* should use the full table name as an alias to avoid naming collisions.
...
@@ -974,7 +974,12 @@ function hook_ranking() {
...
@@ -974,7 +974,12 @@ function hook_ranking() {
'title'
=>
t
(
'Average vote'
),
'title'
=>
t
(
'Average vote'
),
// Note that we use i.sid, the search index's search item id, rather than
// Note that we use i.sid, the search index's search item id, rather than
// n.nid.
// 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,
// The highest possible score should be 1, and the lowest possible score,
// always 0, should be 0.
// always 0, should be 0.
'score'
=>
'vote_node_data.average / CAST(%f AS DECIMAL)'
,
'score'
=>
'vote_node_data.average / CAST(%f AS DECIMAL)'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment