Topic on Extension talk:MixedNamespaceSearchSuggestions

Did not work for us in 1.27

3
Miken32 (talkcontribs)

It seems to be down to the TitleKey extension, which purposely strips off the namespaces. Hacking that extension fixed things for us.

Also we had to add a CSS rule to get the namespace lining up with the article title:

div.suggestions-result {
    white-space: inherit;
}
Jkmartindale (talkcontribs)

How'd you patch TitleKey? I'm interested as well.

Miken32 (talkcontribs)

Basically just comment out the stuff that purposely breaks namespaces:

diff --git a/TitleKey_body.php b/TitleKey_body.php
index 63cf769..b0b7b87 100644
--- a/TitleKey_body.php
+++ b/TitleKey_body.php
@@ -140,10 +140,10 @@ class TitleKey {
        }
        
        static function prefixSearch( $namespaces, $search, $limit, $offset ) {
-               $ns = array_shift( $namespaces ); // support only one namespace
-               if( in_array( NS_MAIN, $namespaces ) )
-                       $ns = NS_MAIN; // if searching on many always default to main 
-               
+#              $ns = array_shift( $namespaces ); // support only one namespace
+#              if( in_array( NS_MAIN, $namespaces ) )
+#                      $ns = NS_MAIN; // if searching on many always default to main 
+               $ns = $namespaces;
                $key = self::normalize( $search );
                
                $dbr = wfGetDB( DB_SLAVE );
Reply to "Did not work for us in 1.27"