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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | apachesolr-translated_menu_title-2446419-4.patch | 1.18 KB | bburg |
| #2 | apachesolr_search-overwritten_menu_items-2446419.patch | 715 bytes | champcy |
| Weird-menu-item.patch | 1.31 KB | bfridman |
Comments
Comment #2
champcy commentedHere is a fixed version of this patch.
Comment #3
bburgI 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.
Comment #4
bburgThis seems to work. Only tested with the use case in this issue though.
Comment #5
bburgComment #7
agileadam#4 worked for me. Thanks @bburg.
Comment #8
andras_szilagyi commented#4 works as intended
Comment #9
enriquelacoma commentedI tested #4 and works as intended.
Comment #10
japerry