Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I brought to the developer of the FuzzySearch module that there is a hook in TopSearch module that allows other modules to send their data as well, but he could not find it. Can you please refer to this issue?
Thanks.
Comments
Comment #1
z.stolar CreditAttribution: z.stolar commentedPlease refer to the function top_searches_top_searches in top_searches.module
Let me know if this is sufficient.
Comment #2
VTM CreditAttribution: VTM commented#awolfey
Can you review?
Comment #3
awolfey CreditAttribution: awolfey commentedYes, I saw that function, but it's not a hook. It's an api function. It looks like it might be implementing its own hook_top_search, but that is never invoked.
What I would suggest for the top searches module is to implement hook_watchdog because that, with only a small piece of code, is like to to gain access immediately to most search modules, rather than needing each search module to call top_search_top_search().
Additionally, hook_watchdog gives you access to everything you need to create some kind of flood or gaming prevetion: user object, IP address, timestamp, uri, etc.
Not tested:
I'm going to move this to the top searches queue. This is really the way to do it I think.