Last modified: 2014-09-22 10:31:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69234, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67234 - PowerSearchBox stopped respecting custom search namespace names from SearchableNamespaces hook
PowerSearchBox stopped respecting custom search namespace names from Searchab...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.23.0
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-28 01:38 UTC by Jeremy
Modified: 2014-09-22 10:31 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jeremy 2014-06-28 01:38:29 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.
Comment 1 Andre Klapper 2014-06-29 22:24:17 UTC
Pardon my ignorance, but what exactly in the code is "PowerSearchBox" and what does it do? (Yes, obviously I'm not a Search engineer.)
Comment 2 Jeremy 2014-06-30 13:09:50 UTC
(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.
Comment 3 Nik Everett 2014-06-30 13:34:45 UTC
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.
Comment 4 Jeremy 2014-06-30 14:18:53 UTC
(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",
        );

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links