Download & Extend

Undocumented hook_ranking in search.api.php

Project:Drupal core
Version:7.x-dev
Component:documentation
Category:bug report
Priority:critical
Assigned:cwgordon7
Status:closed (fixed)
Issue tags:Novice

Issue Summary

In hook_search on line 98 there is:

foreach (module_invoke_all('ranking') as $var => $values) {

There are at least 2 implementations of this hook in core, in node and comment modules.

Comments

#1

Priority:normal» critical

So yeah...we've had this hook undocumented since May 2008. Bumping to critical.

#2

Subscribe. :\

#3

Also? While we're documenting this, can we please change it to hook_search_ranking()? I can think of lots of things that might be ranked. And this would help alphabetize it with the other search hooks.

#4

#5

Assigned to:Anonymous» cwgordon7

I'll document the hook. For the sake of neatness, I'll move the hook's renaming into a separate issue.

#6

For more info - see http://drupal.org/node/145242

#7

Hint: This is currently a node.module specific hook, and not search.module.

#394182: DBTNG search.module would help to make this generic, maybe something like hook_search_ranking_$type.

#8

Pinged cwgordon7 by email to find out status of this.

#9

Status:active» needs review

Here's a patch.

AttachmentSizeStatusTest resultOperations
hook_ranking_01.patch3.72 KBIdlePassed: 11844 passes, 0 fails, 0 exceptionsView details

#10

Status:needs review» reviewed & tested by the community

Very nice ;)

Is there an issue to change the name somewhere else? Both of the other issue linked seem to go in other directions.

#11

My *idea* was to move this to search.module and make it more generic, something like hook_search_$type_ranking as it is currently limited to the node search. But the search.module DBTNGify patch is still not commited and I'm not sure if there is time to do this before code freeze.

#12

Version:7.x-dev» 6.x-dev
Status:reviewed & tested by the community» patch (to be ported)

Excellent work!! :D

Committed to HEAD. Marking down to 6.x. Note that this can be committed to contributions/docs/hooks by anyone with CVS access.

#13

Version:6.x-dev» 7.x-dev
Status:patch (to be ported)» fixed

Doesn't make much sense to port this to 6.x because the hook doesn't exist there. :)

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here