MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/57933


Change subject: merge
......................................................................

merge

Change-Id: Ic738c140144ead51a9f21c56119b9de5ee51f810
---
M includes/api/ApiQueryRecentChanges.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/57933/1

diff --git a/includes/api/ApiQueryRecentChanges.php 
b/includes/api/ApiQueryRecentChanges.php
index 72e80b8..8aceab2 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -159,15 +159,20 @@
 
                        $timestamp = $this->getDB()->addQuotes( wfTimestamp( 
TS_MW, $cont[0] ) );
                        $id = intval( $cont[1] );
-                       $op = $params['dir'] == 'descending' ? '<' : '>';
+                       $op = $params['dir'] === 'older' ? '<' : '>';
 
                        $this->addWhere(
                                "rc_timestamp $op $timestamp OR " .
                                "(rc_timestamp = $timestamp AND " .
-                               "rc_id <= $id)"
+                               "rc_id $op= $id)"
                        );
                }
 
+               $order = $params['dir'] === 'older' ? 'DESC' : 'ASC';
+               $this->addOption( 'ORDER BY', array(
+                       "rc_timestamp $order",
+                       "rc_id $order",
+               ) );
 
                $this->addWhereFld( 'rc_namespace', $params['namespace'] );
                $this->addWhereFld( 'rc_deleted', 0 );

-- 
To view, visit https://gerrit.wikimedia.org/r/57933
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic738c140144ead51a9f21c56119b9de5ee51f810
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_21
Gerrit-Owner: MarkAHershberger <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to