From: Brion Vibber
Date: Sun, 26 Jun 2005 20:05:56 +0000 (+0000)
Subject: * Fix paging on Special:Contributions
X-Git-Tag: 1.5.0beta2~195
X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27votes%27%2C%20votes=%27waiting%27%29%20%7D%7D?a=commitdiff_plain;h=4609ffd0b2ea42488c0924f1fd730b6cc66a0f7f;p=lhc%2Fweb%2Fwiklou.git
* Fix paging on Special:Contributions
---
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index ca394468f4..ffaa3a50fc 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -370,6 +370,7 @@ Various bugfixes, small features, and a few experimental things:
* Conversion fix for empty old table in upgrade1_5.php
* Try reading revisions from master if no result on slave
* (bug 2538) Suppress notice on user serialized checks
+* Fix paging on Special:Contributions
=== Caveats ===
diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php
index e4e4840613..1750b4d959 100644
--- a/includes/SpecialContributions.php
+++ b/includes/SpecialContributions.php
@@ -29,8 +29,7 @@ function wfSpecialContributions( $par = null ) {
# FIXME: Change from numeric offsets to date offsets
list( $limit, $offset ) = wfCheckLimits( 50, '' );
- $offlimit = $limit + $offset;
- $querylimit = $offlimit + 1;
+ $querylimit = $limit + 1;
$sk = $wgUser->getSkin();
$dbr =& wfGetDB( DB_SLAVE );
$userCond = "";
@@ -99,7 +98,7 @@ function wfSpecialContributions( $par = null ) {
rev_deleted
FROM $page,$revision $use_index
WHERE page_id=rev_page AND $condition $minorQuery " .
- "ORDER BY rev_timestamp DESC LIMIT {$querylimit}";
+ "ORDER BY rev_timestamp DESC " . $dbr->limitResult( $querylimit, $offset );
$res = $dbr->query( $sql, $fname );
$numRows = $dbr->numRows( $res );
@@ -111,7 +110,7 @@ function wfSpecialContributions( $par = null ) {
$sl = wfViewPrevNext( $offset, $limit,
$wgContLang->specialpage( "Contributions" ),
"hideminor={$hideminor}&namespace={$namespace}&target=" . wfUrlEncode( $target ),
- ($numRows) <= $offlimit);
+ ($numRows) <= $limit);
$shm = wfMsg( "showhideminor", $mlink );
$wgOut->addHTML( "
{$sl} ($shm)
\n");
@@ -123,9 +122,15 @@ function wfSpecialContributions( $par = null ) {
}
$wgOut->addHTML( "\n" );
+ $n = 0;
while( $obj = $dbr->fetchObject( $res ) ) {
+ if( ++$n > $limit ) {
+ // Extra row for determining 'next'ability, don't display
+ break;
+ }
$wgOut->addHTML( ucListEdit( $sk, $obj ) );
}
+ $dbr->freeResult( $res );
$wgOut->addHTML( "
\n" );
$wgOut->addHTML( "
{$sl} ($shm)\n");