Closed (fixed)
Project:
Search Engine Referer API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
12 Oct 2010 at 10:41 UTC
Updated:
10 Jan 2012 at 17:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
kenorb commentedPatch in attachment.
Comment #2
yaph commentedThanks for the patch. One question: should serapi_search_engine_list be named hook_serapi_search_engine_list to be immediately recognizable as a hook?
Comment #3
kenorb commentedNo. None of the function can contain 'hook' word.
When you execute module_invoke_all() it will automatically call all the instances of this hook and merge the data. No need to define hook in some special way.
See: http://api.drupal.org/api/function/module_invoke_all/6 ($function = $module .'_'. $hook;)
In my opinion hook_search_engine_list is a better name than get_engine_list, because in hooks you set those engines, not get.
Serapi module it-self contains implementation of this hook, and I've got following function defined in my separated module:
where I've defined my local environment, production and live server.
Functionality is tested and works on my environment.
I need those internal search engines to generate proper breadcrumbs and have access to search keywords from internal search engine.
Some examples of usage serapi module in crumbs module
#926266: How to change the path of the crumbs?
#933230: Add debug option to show which method has been called
#925382: Method of override breadcrumb completely
Comment #4
yaph commentedThanks for the explanation! I applied your patch locally, but now the tests fail, because of the use of module_invoke_all. I'll see how I can fix this before I commit the changes.
Comment #5
kenorb commentedThanks.
It will be great.
Comment #6
yaph commentedIn the latest commit (http://drupal.org/cvs?commit=435576) I renamed serapi_get_engine_list to serapi_search_engine_list and made it a hook. I also added a new function that doesn't call module_invoke_all to be testable.
Thanks again for your great suggestion and patch.
Comment #7
yaph commentedI added a new release with the hook feature http://drupal.org/node/940846
Comment #8
trrroy commentedThis was added to the 6.x-2.0-beta1 release.