r108751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108750‎ | r108751 | r108752 >
Date:20:05, 12 January 2012
Author:reedy
Status:ok
Tags:
Comment:
MFT r108712 to fix fixme on r107975

Tests not merged
Modified paths:
  • /branches/wmf/1.18wmf1 (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/specials/SpecialSearch.php
@@ -87,6 +87,9 @@
8888
8989 /**
9090 * Set up basic search parameters from the request and user settings.
 91+ *
 92+ * @see tests/phpunit/includes/specials/SpecialSearchTest.php
 93+ *
9194 * Typically you'll pass $wgRequest and $wgUser.
9295 *
9396 * @param $request WebRequest
@@ -97,27 +100,30 @@
98101 $this->mPrefix = $request->getVal( 'prefix', '' );
99102
100103
 104+
101105 # Extract manually requested namespaces
102106 $nslist = $this->powerSearch( $request );
 107+ if ( !count( $nslist ) ) {
 108+ # Fallback to user preference
 109+ $nslist = SearchEngine::userNamespaces( $user );
 110+ }
 111+
103112 $profile = null;
104113 if ( !count( $nslist ) ) {
105114 $profile = 'default';
106115 }
 116+
107117 $profile = $request->getVal( 'profile', $profile );
108118 $profiles = $this->getSearchProfiles();
109119 if ( $profile === null ) {
110120 // BC with old request format
111121 $profile = 'advanced';
112 - if ( count( $nslist ) ) {
113 - foreach( $profiles as $key => $data ) {
114 - if ( $nslist === $data['namespaces'] && $key !== 'advanced') {
115 - $profile = $key;
116 - }
 122+ foreach( $profiles as $key => $data ) {
 123+ if ( $nslist === $data['namespaces'] && $key !== 'advanced') {
 124+ $profile = $key;
117125 }
118 - $this->namespaces = $nslist;
119 - } else {
120 - $this->namespaces = SearchEngine::userNamespaces( $user );
121126 }
 127+ $this->namespaces = $nslist;
122128 } elseif ( $profile === 'advanced' ) {
123129 $this->namespaces = $nslist;
124130 } else {
Property changes on: branches/wmf/1.18wmf1
___________________________________________________________________
Modified: svn:mergeinfo
125131 Merged /trunk/phase3:r108712

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107975MFT r105341, t105853, r106780reedy00:40, 4 January 2012
r108712bug 33583 search ns user pref ignored!...hashar09:03, 12 January 2012

Status & tagging log