Hi Robert,

Definitely a needed functionality, thanks for posting this. I was wrestling today with the same issue. I tried to see if it could be done without patching. Attached is the result.

Approach:

* Configuration options on search settings page to select whether to enable node, user searching
* Uses module weight to conditionally preempt search module's user and node search items. If disabled, we set a menu item with access FALSE.
* Alter the search box form to avoid forwarding to search/node if node searching is disabled.

I did only minimal testing.

This may leave some holes, as node and user will still respond to module_implements('search').

Thoughts?

CommentFileSizeAuthor
coresearches.patch3.62 KBnedjo

Comments

owen barton’s picture

This is the exact same idea I had when reading the module description :)

I think this is a simpler approach than a patch, and is certainly a lot easier to use!

My original thought was to set the callback to '', which (IIRC) should effectively nuke the menu item out of existence, unlike setting access to FALSE which I think would give an access denied (rather than 404) if the URL was accessed directly. The two approaches are pretty equivalent though.

robertdouglass’s picture

Status: Needs review » Closed (won't fix)

Part of the goal is removing nearly 400 lines of code from core and not doing indexing for a search you don't intend to use. This module represents a clean solution, not just a cover-up of the problem. Hopefully I or someone will have enough energy in D7 to make this separation part of core.