r104765 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104764‎ | r104765 | r104766 >
Date:22:38, 30 November 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 16434) Fix paging on Special:Prefixindex when prefix is empty (whole namespace).

Tweaked input handling to make sure the 'from' => 'prefix' mapping doesn't happen if we have passed a namespace parameter (indicating we're working within the form). Tweaked the form paging links to include the NS even if it's 0. :)
Originally wanted to just check for presence of 'prefix' however wfArrayToCgi() strips empty values, and I'm not comfortable tweaking that without a lot more testing.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPrefixindex.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPrefixindex.php
@@ -65,8 +65,9 @@
6666 $showme = $par;
6767 } elseif( $prefix != '' ) {
6868 $showme = $prefix;
69 - } elseif( $from != '' ) {
 69+ } elseif( $from != '' && $ns === null ) {
7070 // For back-compat with Special:Allpages
 71+ // Don't do this if namespace is passed, so paging works when doing NS views.
7172 $showme = $from;
7273 }
7374
@@ -216,10 +217,11 @@
217218 'prefix' => $prefix
218219 );
219220
220 - if( $namespace ) {
 221+ if( $namespace || ($prefix == '')) {
 222+ // Keep the namespace even if it's 0 for empty prefixes.
 223+ // This tells us we're not just a holdover from old links.
221224 $query['namespace'] = $namespace;
222225 }
223 -
224226 $nextLink = Linker::linkKnown(
225227 $self,
226228 wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),

Sign-offs

UserFlagDate
Bawolfftested08:01, 20 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47984(bug 16434) Fixed Special:PrefixIndex paging with no prefixaaron19:58, 3 March 2009

Status & tagging log