The code in plugins/tasks/search.inc is quite problematic. I don't know what it's trying to achieve, but it duplicates the tabs such that the core search behavior of switching searches between tabs is gone, forces a 'Search' tab to show up which may not be desired, and in general seems half baked since all the comments refer to 'node view '.

The menu alter seems to run even if the search panel page is not enabled, and there seems to be no setting to disable it.

Perhaps this would be at least partially resolved by changing this code:

// automatically disable this task if it cannot be enabled.
variable_set('page_manager_search_disabled_' . $name, TRUE);

to:

      // automatically disable this task if it cannot be enabled.
      variable_set('page_manager_search_disabled_' . $name, FALSE);

or otherwise fixing the logic so that the auto-disabling works.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

What is half-baked is how search module handles its tabs (which is incredibly poorly).

That said, perhaps you should read the code you're suggesting changing, since you want to make the auto-disable an auto-enable.

merlinofchaos’s picture

Ok, so I see what you mean about the search keywords not being carried through. (I actually had no idea they were meant to be. That's interesting).

I don't see the duplicated tabs in my install.

pwolanin’s picture

The tabs are duplicated in the sense of both getting the tailing % and not. That is, they are duplicated in the database, not visually. Sorry for not being clear about that.

The auto-disabling is not working - Perhaps what is missing is a ! in the check.

I know search module is a pain - just trying to avoid have it break even more especially in combination with apachesolr.

pwolanin’s picture

lijiele’s picture

I have the same problem.

The easy way i fixed like that :

mv search.inc search.inc.bak

and then go to the page admin/build/modules , click 'Save configuartion' .

lijiele’s picture

I have resolved it by use the module weight and menu_alter.
For example, my module name is [mymodule]
1.fmymodule.install

function mymodule_install() {
//db_query("UPDATE {system} SET weight = 99 WHERE name = 'page_manager'");
//set the module's weight after the page_manager
//to run the hook hook_menu_alter successful
db_query("UPDATE {system} SET weight = 100 WHERE name = 'mymodule'");
}

2.mymodule.module

function mymodule_menu_alter(&$items) {
  if(module_exists('search') && module_exists('page_manager')) {
    foreach (module_implements('search') as $name) {
      unset($items["search/$name"]);
    }
  }
}
merlinofchaos’s picture

Part of this problem is solved by http://drupal.org/node/722246

merlinofchaos’s picture

Status: Active » Needs review
FileSize
4 KB

Here's a patch that I think fixes this.

merlinofchaos’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
FileSize
5.53 KB

Committed this patch (slightly improved from #8). Marking for 7.x porting.

grendzy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Needs work
FileSize
30.2 KB

By altering the values of {menu_router}.tab_root and tab_parent, it causes the title of the search page to change to "Home". (see #817810: Search page title changes to Home)

merlinofchaos’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Patch (to be ported)

That doesn't invalidate this patch. It means we need a followup. Let's do that at http://drupal.org/node/817810

merlinofchaos’s picture

Status: Patch (to be ported) » Closed (duplicate)

All of the 'to be ported' patches got merged in during the porting sprint in September.

mstef’s picture

Status: Closed (duplicate) » Active

Still seeing this with the latest 6.x..

Looking into it now

merlinofchaos’s picture

Status: Active » Closed (duplicate)

There's too much going on in this issue, including at least 2 links to other issues, for a single sentence (seeing this) to be helpful. Let's try a new issue if you've got some specifics. It can reference back to this one. Plus, the last comment re-opened it saying 6.x but didn't change the version.