Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
286
Merge Requests
286
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
8790ec0d
Commit
8790ec0d
authored
Dec 05, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2017433
by BarisW: The documentation for hook_ranking() is wrong
parent
d6125585
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
core/modules/node/node.api.php
core/modules/node/node.api.php
+7
-2
No files found.
core/modules/node/node.api.php
View file @
8790ec0d
...
...
@@ -490,7 +490,7 @@ function hook_node_submit(\Drupal\node\NodeInterface $node, $form, \Drupal\Core\
* '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.
...
...
@@ -514,7 +514,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)'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment