When I enable this module, and the core module "Search" is disabled, the site stop working completly (blank page).

Would be good, if In the requirements, the core module "Search" exists.

Log:

mod_fcgid: stderr: PHP Fatal error: Call to undefined function search_get_default_module_info() in /web/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/search.inc on line 63

File
modules/search/search.module, line 281
https://api.drupal.org/api/drupal/modules!search!search.module/function/...

Thanks.

CommentFileSizeAuthor
#6 2075659-6-ctools-hook-collision.diff544 bytesfeng-shui

Comments

realityloop’s picture

Search isn't technically a requirement, as this module can be used with search_api, so we can't really add search as a dependency, your welcome to submit a patch for us to review, or to engage us for a fix otherwise we'll get to it when we have some free time

The correct fix would be to use hook_requirements() or similar to check if either Search or Search API was present, and if not show a warning.

azinck’s picture

Issue summary: View changes

This is actually caused by a naming collision with a task plugin provided by ctools' page_manager submodule. The function page_manager_search_menu_alter() is defined here: http://cgit.drupalcode.org/ctools/tree/page_manager/plugins/tasks/search...

So once you've enabled page_manager_search on your site, that function becomes a match for hook_menu_alter and gets called whenever you rebuild your menus. Incidentally, there's also a naming collision around hook_enable.

The solution would seem to be to either rename this module, or rename the functions in ctools. As this module is quite young I'd suggest renaming the module.

acrollet’s picture

FYI I experienced this issue, re-naming the module took care of the issue for me.

badrange’s picture

This is a pretty annoying issue that also affects us. Would the module authors accept a patch that renames this module, to for example pagemanagersearch?

damienmckenna’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

I think it's a little too late to rename the module. However, it may be possible to change using e.g. hook_hook_info_alter(), though I have yet to test this theory.

feng-shui’s picture

Status: Active » Needs review
StatusFileSize
new544 bytes

The attached patch uses hook_module_implements_alter to prevent the hook system from invoking page_manager_search_menu_alter. This obviously prevents the use of this module implementing that hook at any point in the future without the renaming of the module, or the ctools function.

umtj’s picture

Status: Needs review » Reviewed & tested by the community
joshua.boltz’s picture

Verified the patch in #6 solves the fatal error when core Search module is not enabled.

renatog’s picture

#6 really makes sense. Thank you so much for that

  • RenatoG committed a442f49 on 7.x-1.x authored by Feng-Shui
    Issue #2075659 by Feng-Shui, realityloop, acrollet, azinck, badrange,...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Moved to the dev branch 7.x-1.x

Thank you so much everyone for your contribution

Status: Fixed » Closed (fixed)

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