HistoryPager: Unset 'date-range-to' parameter when paging
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 12 Apr 2019 00:20:28 +0000 (02:20 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 12 Apr 2019 00:21:51 +0000 (02:21 +0200)
Follow-up to 1b27cee8979b2fefa65dafee237485787693eb98. This fixes
paging on Special:History, and matches the existing behavior for the
previously supported 'year'/'month' parameters.

It is possible that this should be unset in IndexPager. However, in a
quick test, other pagers that have filtering by date seem to function
correctly already (tested Special:Contributions and Special:Log).
I'm making this change in HistoryPager to avoid accidentally breaking
anything, but perhaps this should be reevaluated.

Maybe the real bug is that 'date-range-to' is not ignored when
'offset' is specified?

Bug: T220781
Change-Id: I01c309178e6d5d9c919f410c64e2b833a5750141

includes/actions/pagers/HistoryPager.php

index 4e9d8e9..c9c1b51 100644 (file)
@@ -602,6 +602,15 @@ class HistoryPager extends ReverseChronologicalPager {
                }
        }
 
+       /**
+        * @inheritDoc
+        */
+       function getDefaultQuery() {
+               parent::getDefaultQuery();
+               unset( $this->mDefaultQuery['date-range-to'] );
+               return $this->mDefaultQuery;
+       }
+
        /**
         * This is called if a write operation is possible from the generated HTML
         * @param bool $enable