r52023 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52022‎ | r52023 | r52024 >
Date:06:59, 17 June 2009
Author:mrzman
Status:ok
Tags:
Comment:
Partial fix for bug 19236 - the array you want to override others should come last in array_merge().
This fixes the "next" links, limit links, and filters. The "previous" links are still broken.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -334,18 +334,18 @@
335335
336336 if ( 0 != $prevId ) {
337337 $overrides = array( 'from' => $this->opts->getValue( 'back' ) );
338 - $prev = $this->makeSelfLink( $prev, array_merge( $overrides, $changed ) );
 338+ $prev = $this->makeSelfLink( $prev, array_merge( $changed, $overrides ) );
339339 }
340340 if ( 0 != $nextId ) {
341341 $overrides = array( 'from' => $nextId, 'back' => $prevId );
342 - $next = $this->makeSelfLink( $next, array_merge( $overrides, $changed ) );
 342+ $next = $this->makeSelfLink( $next, array_merge( $changed, $overrides ) );
343343 }
344344
345345 $limitLinks = array();
346346 foreach ( $this->limits as $limit ) {
347347 $prettyLimit = $wgLang->formatNum( $limit );
348348 $overrides = array( 'limit' => $limit );
349 - $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $overrides, $changed ) );
 349+ $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $changed, $overrides ) );
350350 }
351351
352352 $nums = $wgLang->pipeList( $limitLinks );
@@ -412,7 +412,7 @@
413413 $chosen = $this->opts->getValue( $type );
414414 $msg = wfMsgHtml( "whatlinkshere-{$type}", $chosen ? $show : $hide );
415415 $overrides = array( $type => !$chosen );
416 - $links[] = $this->makeSelfLink( $msg, array_merge( $overrides, $changed ) );
 416+ $links[] = $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) );
417417 }
418418 return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $wgLang->pipeList( $links ) );
419419 }

Status & tagging log