When I visit the /search page the page title is "Search", after making a search the page title changes to "Home".

I would think that if this page was returning a result the page title would be something like: "Search results for "my search terms""?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Wow. This seems like a fairly serious bug... Is this just with Drupal core modules enabled and nothing else?

Jeff Burnz’s picture

I have DEVEL enabled and that's it other than core modules.

I should make it clear this is not a feature request for the page-title suggestion I made above - but at least the page title should remain as "Search" and not switch to "Home" which is pretty confusing especially for blind users.

jhodgdon’s picture

OK. That is definitely a problem if this is happening -- it should definitely not be changing. I'll investigate (unless someone beats me to it).

rayasa’s picture

Status: Active » Needs review
FileSize
532 bytes

he issue seems to be in the function menu_set_active_trail() in menu.inc.

To fetch the active 'menu_name' (in this case 'navigation') a DB query is made on the 'menu_links' table with a 'link_path' that may or may not exist.

The link_path is being fetched from $item('href') that parses to search/node/<"Your Search Keyword">. A better option would be $item['tab_root'].

The 'menu_name' is required to get the tree data ==> to form the current active breadcrumb and to get the active title.

The patch might fix the problem.

Status: Needs review » Needs work

The last submitted patch, menu.inc_.patch, failed testing.

jhodgdon’s picture

Ah. Then this is a side effect of the somewhat screwy but necessary changes that were made to how the menu system is being used for the Search module in another issue, which for some reason I cannot locate at the moment.

Rather than "fixing" how the menu system is working (which isn't the problem), we need to do a drupal_set_title() in the search page callback.

jhodgdon’s picture

Status: Needs work » Closed (duplicate)

Here's the issue:
#245103: Search page tabs not highlighting

Actually, I'm going to reopen that issue and mark this one as a duplicate, since it is an artifact of the solution that was done there.

moreorless’s picture

I have also seen the Search page title changing to Home, but in Drupal 6.

Tracked the problem to Chaos Tools Page Manager. Once that was disabled the title changed back from Home to Search.

The problem only seems to have occurred with Chaos Tools 6.x-1.6.

jhodgdon’s picture

Status: Closed (duplicate) » Active

That was too confusing.

This issue is occurring now in Drupal 7 so I am reopening this issue and marking #245103: Search page tabs not highlighting back to Fixed.

There is a patch on http://drupal.org/files/issues/245103-fixactivetrail.patch that may fix this issue, but it needs testing.

jhodgdon’s picture

Priority: Normal » Major
FileSize
52.27 KB

I also think this is "Major", because it's very confusing. See screen shot. We definitely do not want to release D7 with this issue unfixed.

jhodgdon’s picture

Status: Active » Needs review
FileSize
5.42 KB

Here's a reroll of the patch that was on that other issue. It fixes the problem, and adds tests to make sure it stays fixed.

And yes, it's ugly. Better solutions would be welcome, especially if they also pass the same test that's in this patch.

pwolanin’s picture

jhodgdon’s picture

Status: Needs review » Closed (duplicate)

Yes, it is apparently a duplicate of that other issue. I will add a comment there with this test.

dunx’s picture

Issue summary: View changes

Comment deleted.