(bug 48212) Fix I720946e7: $this->opts['year'] shouldn't be modified.
authorLiangent <liangent@gmail.com>
Tue, 7 May 2013 15:43:22 +0000 (15:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 May 2013 19:31:59 +0000 (19:31 +0000)
Otherwise, the offset is set automatically based on the default 'year'
parameter, then ReverseChronologicalPager gets misled and assumes that
the user have already specified a starting point so there must be a
previous page, causing a 'prev' link returning nothing shown.

Bug: 48212
Bug: 45580
Change-Id: I5341ff8c0d0422b9b3184dce74f0f143822cfe93

includes/specials/SpecialContributions.php

index 52261c9..21becd6 100644 (file)
@@ -388,7 +388,7 @@ class SpecialContributions extends SpecialPage {
                }
 
                if ( !isset( $this->opts['year'] ) ) {
-                       $this->opts['year'] = gmdate( 'Y' );
+                       $this->opts['year'] = '';
                }
 
                if ( !isset( $this->opts['month'] ) ) {
@@ -566,7 +566,7 @@ class SpecialContributions extends SpecialPage {
 
                $dateSelectionAndSubmit = Xml::tags( 'td', array( 'colspan' => 2 ),
                        Xml::dateMenu(
-                               $this->opts['year'],
+                               $this->opts['year'] === '' ? gmdate( 'Y' ) : $this->opts['year'],
                                $this->opts['month']
                        ) . ' ' .
                                Xml::submitButton(