Download & Extend

Search page title changes to Home

Project:Drupal core
Version:7.x-dev
Component:search.module
Category:bug report
Priority:major
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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""?

AttachmentSizeStatusTest resultOperations
Search-Page-Title-Default.png5.09 KBIgnored: Check issue status.NoneNone
Search-Page-Title-Results.png8.42 KBIgnored: Check issue status.NoneNone

Comments

#1

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

#2

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.

#3

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).

#4

Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
menu.inc_.patch532 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 20,536 pass(es), 8 fail(s), and 0 exception(es).View details | Re-test

#5

Status:needs review» needs work

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

#6

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.

#7

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.

#8

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.

#9

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.

#10

Priority:normal» major

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.

AttachmentSizeStatusTest resultOperations
badtitle.png52.27 KBIgnored: Check issue status.NoneNone

#11

Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
812990-activetrailfix.patch5.42 KBIdlePASSED: [[SimpleTest]]: [MySQL] 22,792 pass(es).View details | Re-test

#12

#13

Status:needs review» closed (duplicate)

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

nobody click here