(bug 35980) drcontinue should pay attention to drdir in "all" mode
authorBrad Jorsch <anomie.wikipedia@gmail.com>
Fri, 1 Jun 2012 21:46:40 +0000 (23:46 +0200)
committerBrad Jorsch <anomie.wikipedia@gmail.com>
Sat, 7 Jul 2012 00:54:43 +0000 (20:54 -0400)
In "all" mode (mode #3 in the module's documentation), the drdir
parameter is treated by the result ordering as if it were always
drdir=newer; drcontinue, on the other hand, always tries to honor drdir
correctly, leading to the drcontinue not actually working unless drdir
is specifically given.

This fixes that.

Change-Id: Icf6982d0ba55490b7a7ae3a1ee6c94c40f1c3c64

RELEASE-NOTES-1.20
includes/api/ApiQueryDeletedrevs.php

index ec50096..423e44f 100644 (file)
@@ -183,6 +183,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 32383) Allow descending order for list=langbacklinks
 * API meta=siteinfo can now return the list of known variable IDs
 * (bug 30836) siteinfo prop=specialpagealiases will no longer return nonexistent special pages
+* (bug 35980) list=deletedrevs now honors drdir correctly in "all" mode (mode #3)
 
 === Languages updated in 1.20 ===
 
index 06f649d..df5e303 100644 (file)
@@ -180,9 +180,10 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        if ( $params['unique'] ) {
                                $this->addOption( 'GROUP BY', 'ar_title' );
                        } else {
+                               $sort = ( $dir == 'newer' ? '' : ' DESC' );
                                $this->addOption( 'ORDER BY', array(
-                                       'ar_title',
-                                       'ar_timestamp'
+                                       'ar_title' . $sort,
+                                       'ar_timestamp' . $sort
                                ));
                        }
                } else {