r107975 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107974‎ | r107975 | r107976 >
Date:00:40, 4 January 2012
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
MFT r105341, t105853, r106780
Modified paths:
  • /branches/wmf/1.18wmf1 (modified) (history)
  • /branches/wmf/1.18wmf1/includes (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialAllmessages.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialBlockList.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/specials/SpecialAllmessages.php
@@ -62,9 +62,6 @@
6363
6464 $out->addModuleStyles( 'mediawiki.special' );
6565
66 - $this->filter = $request->getVal( 'filter', 'all' );
67 - $this->prefix = $request->getVal( 'prefix', '' );
68 -
6966 $this->table = new AllmessagesTablePager(
7067 $this,
7168 array(),
@@ -118,10 +115,13 @@
119116 $this->langcode = $this->lang->getCode();
120117 $this->foreign = $this->langcode != $wgContLang->getCode();
121118
122 - if( $wgRequest->getVal( 'filter', 'all' ) === 'all' ){
 119+ $request = $this->getRequest();
 120+
 121+ $this->filter = $request->getVal( 'filter', 'all' );
 122+ if( $this->filter === 'all' ){
123123 $this->custom = null; // So won't match in either case
124124 } else {
125 - $this->custom = ($wgRequest->getVal( 'filter' ) == 'unmodified');
 125+ $this->custom = ($this->filter == 'unmodified');
126126 }
127127
128128 $prefix = $wgLang->ucfirst( $wgRequest->getVal( 'prefix', '' ) );
Property changes on: branches/wmf/1.18wmf1/includes/specials/SpecialAllmessages.php
___________________________________________________________________
Modified: svn:mergeinfo
129129 Merged /trunk/phase3/includes/specials/SpecialAllmessages.php:r105853,106780
Index: branches/wmf/1.18wmf1/includes/specials/SpecialBlockList.php
@@ -427,7 +427,11 @@
428428 return true;
429429 }
430430
431 - if ( !in_array( $value, $this->mParams['options'] ) ) {
 431+ // Let folks pick an explicit limit not from our list, as long as it's a real numbr.
 432+ if ( !in_array( $value, $this->mParams['options'] ) && $value == intval( $value ) && $value > 0 ) {
 433+ // This adds the explicitly requested limit value to the drop-down,
 434+ // then makes sure it's sorted correctly so when we output the list
 435+ // later, the custom option doesn't just show up last.
432436 $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
433437 asort( $this->mParams['options'] );
434438 }
Property changes on: branches/wmf/1.18wmf1/includes/specials/SpecialBlockList.php
___________________________________________________________________
Modified: svn:mergeinfo
435439 Merged /trunk/phase3/includes/specials/SpecialBlockList.php:r105341,105853,106780
Index: branches/wmf/1.18wmf1/includes/specials/SpecialSearch.php
@@ -99,15 +99,19 @@
100100
101101 # Extract manually requested namespaces
102102 $nslist = $this->powerSearch( $request );
103 - $this->profile = $profile = $request->getVal( 'profile', null );
 103+ $profile = null;
 104+ if ( !count( $nslist ) ) {
 105+ $profile = 'default';
 106+ }
 107+ $profile = $request->getVal( 'profile', $profile );
104108 $profiles = $this->getSearchProfiles();
105 - if ( $profile === null) {
 109+ if ( $profile === null ) {
106110 // BC with old request format
107 - $this->profile = 'advanced';
 111+ $profile = 'advanced';
108112 if ( count( $nslist ) ) {
109113 foreach( $profiles as $key => $data ) {
110114 if ( $nslist === $data['namespaces'] && $key !== 'advanced') {
111 - $this->profile = $key;
 115+ $profile = $key;
112116 }
113117 }
114118 $this->namespaces = $nslist;
@@ -121,7 +125,7 @@
122126 $this->namespaces = $profiles[$profile]['namespaces'];
123127 } else {
124128 // Unknown profile requested
125 - $this->profile = 'default';
 129+ $profile = 'default';
126130 $this->namespaces = $profiles['default']['namespaces'];
127131 }
128132 }
@@ -132,6 +136,7 @@
133137 $this->sk = $this->getSkin();
134138 $this->didYouMeanHtml = ''; # html of did you mean... link
135139 $this->fulltext = $request->getVal('fulltext');
 140+ $this->profile = $profile;
136141 }
137142
138143 /**
Property changes on: branches/wmf/1.18wmf1/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
139144 Merged /trunk/phase3/includes/specials:r105341,105853,106780
Property changes on: branches/wmf/1.18wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
140145 Merged /trunk/phase3/includes:r105341,105853,106780
Property changes on: branches/wmf/1.18wmf1
___________________________________________________________________
Modified: svn:mergeinfo
141146 Merged /trunk/phase3:r105341,105853,106780

Follow-up revisions

RevisionCommit summaryAuthorDate
r107998Attempting to fix r107975, undefined function getRequestnikerabbit08:46, 4 January 2012
r108751MFT r108712 to fix fixme on r107975...reedy20:05, 12 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105341Followup r104350, r104318: only allow custom limits through if they're valid ...brion19:45, 6 December 2011
r105853* (bug 32958) SpecialAllMessages: input form doesn't show and remember filter...brion06:27, 12 December 2011
r106780Fix for bug 33270: default to 'default' search profile...nikerabbit11:17, 20 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:42, 4 January 2012
[10:07:47]  Raymond_afk> [https://de.wikipedia.org/wiki/Spezial:MediaWiki-Systemnachrichten https://de.wikipedia.org/wiki/Spezial:MediaWiki-Systemnachrichten]
[10:07:51]  Raymond_afk> PHP fatal error in /usr/local/apache/common-local/php-1.18/includes/specials/SpecialAllmessages.php line 118: 
[10:07:55]  Raymond_afk> Call to undefined method AllmessagesTablePager::getRequest() 
#Comment by Reedy (talk | contribs)   13:28, 4 January 2012

Bleh, REL1_18 will need fixing also. Keeping track of all these is a pita

#Comment by Reedy (talk | contribs)   13:31, 4 January 2012

Yup, IndexPager seems to have been made to extend ContextSource in 1.19

#Comment by Hashar (talk | contribs)   11:49, 9 January 2012

This cause in production bug 33583 - "Search namespaces from Special:Preferences are ignored"

Confirmed on mediawiki.org

  • set your namespace searching option to (Main)
  • in the top right input box search for "foobar"
  • Search page show pages from Manual and Extension namespaces.

This is caused by the merge of r106780 (currently marked as fixme)

#Comment by Hashar (talk | contribs)   09:05, 12 January 2012

Need a merge of r108712 to be fixed.

Status & tagging log