Last modified: 2014-09-22 10:31:07 UTC
PowerSearchBox stopped respecting custom search namespace names from the SearchableNamespaces hook. This change happened between 1.21 and 1.23. In SpecialSearch.php, the powerSearchBox function changed this line: $name = str_replace( '_', ' ', $name ); to $name = $wgContLang->getConverter()->convertNamespace( $namespace ); The SearchableNamespaces hook allows the searchable namespaces array to be identified as: $arr[ns] => $name However, the new code in powerSearchBox ignores the ability to use custom names from this hook, and forces only the system names to be used.
Pardon my ignorance, but what exactly in the code is "PowerSearchBox" and what does it do? (Yes, obviously I'm not a Search engineer.)
(In reply to Andre Klapper from comment #1) > Pardon my ignorance, but what exactly in the code is "PowerSearchBox" and > what does it do? (Yes, obviously I'm not a Search engineer.) PowerSearchBox is (generally) the code that displays the namespace checkboxes when a user clicks "Advanced" from the search page.
Jeremy - I've never called it that but I imagine your usage predates mine. Can you post a sample of LocalSettings.php that creates the problem custom search namespace names? That's probably the best way for me to reproduce the problem. I can see if I can work that into a unit test so we don't break it again.
(In reply to Nik Everett from comment #3) > Jeremy - I've never called it that but I imagine your usage predates mine. > Can you post a sample of LocalSettings.php that creates the problem custom > search namespace names? That's probably the best way for me to reproduce > the problem. I can see if I can work that into a unit test so we don't > break it again. Nik, I was referring to the function name within SpecialSearch.php, not so much the Advanced search options. :) Here is what we are using in LocalSettings.php, including some of our own namespaces: $wgSearchTheseNamespaces = array(0 =>"Main Content", 90 => "Discussions", NS_HELP => "Help", NS_CATEGORY => "Category", 6 => "Files", NS_SUPERVISOR => "Supervisor", NS_TL => "Tech Lead", NS_RC => "Repair Coach", NS_GM=> "Managers", NS_TRAINING => "Training", );