Some pages has incorrect title in browser.
It contains 'Search Results' in place of specified title.

Some menu item names also corrupted. It also displays 'Search Results' in place of specified item name.

Bug reproduced on each page and menu item where page title and menu item name equils to apachesolr search page name.

This bug starts to reproduce after updating to 7.x-1.7 from. The buggy file is apachesolr_search.module.
I fixed it and can provide patch. It fixes both problems: menu item name and tab title as well.
I analized changelog for this module and found that regression caused by #1314664 by stefan.r, pwolanin, Nick_vh, mindbat, brunogoossens | brianV: Fixed Search pages custom pages title setting does nothing.
https://www.drupal.org/node/1314664

Patch attached.

Comments

Status: Needs review » Needs work

The last submitted patch, Weird-menu-item.patch, failed testing.

champcy’s picture

Here is a fixed version of this patch.

bburg’s picture

I am running into this same issue, but the patch in #2 does not appear to help in my situation.

This seems to pop up when you have menu translation enabled and the Search result text is the default page title set in apachesolr_search_get_value_title(), which is the title_callback for the search page used in _menu_item_localize(). That function would get the correct title from apachesolr_search_page_load(), but only if $value (not sure what this is, a query string?) or $terms (facet values maybe?) are not empty, which is the case as we are loading the search page settings from a different location (i.e. any other page on the site).

Removing the check for if ((!empty($value) || !empty($terms)) && isset($search_page_id)) in apachesolr_search_get_value_title() appears to work for me, but I don't know what other horrible things this will do, presumably it is there for a reason.

I'll play around with this some more and post any findings I come across.

bburg’s picture

This seems to work. Only tested with the use case in this issue though.

bburg’s picture

Status: Needs work » Needs review

The last submitted patch, 2: apachesolr_search-overwritten_menu_items-2446419.patch, failed testing.

agileadam’s picture

#4 worked for me. Thanks @bburg.

andras_szilagyi’s picture

Status: Needs review » Reviewed & tested by the community

#4 works as intended

enriquelacoma’s picture

I tested #4 and works as intended.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

  • japerry committed eff2eeb on 7.x-1.x authored by bburg
    Issue #2446419 by bburg, champcy, bfridman: Incorrect display of some...

Status: Fixed » Closed (fixed)

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