* (bug 36761) "Mark pages as visited" now submits previously established filter options
* (bug 32643) action=purge with forcelinkupdate no longer crashes when ratelimit is reached
* The paraminfo module now also contains result properties for most modules
+* (bug 32348) Allow descending order for list=alllinks
=== Languages updated in 1.20 ===
if ( count( $continueArr ) != 2 ) {
$this->dieUsage( 'Invalid continue parameter', 'badcontinue' );
}
+ $op = $params['dir'] == 'descending' ? '<' : '>';
$continueTitle = $db->addQuotes( $this->titleToKey( $continueArr[0] ) );
$continueFrom = intval( $continueArr[1] );
$this->addWhere(
- "pl_title > $continueTitle OR " .
+ "pl_title $op $continueTitle OR " .
"(pl_title = $continueTitle AND " .
- "pl_from > $continueFrom)"
+ "pl_from $op= $continueFrom)"
);
}
$limit = $params['limit'];
$this->addOption( 'LIMIT', $limit + 1 );
+ $sort = ( $params['dir'] == 'descending' ? ' DESC' : '' );
+ $orderBy = array();
+ $orderBy[] = 'pl_title' . $sort;
if ( !$params['unique'] ) {
- $this->addOption( 'ORDER BY', array(
- 'pl_title',
- 'pl_from'
- ));
+ $orderBy[] = 'pl_from' . $sort;
}
+ $this->addOption( 'ORDER BY', $orderBy );
$res = $this->select( __METHOD__ );
ApiBase::PARAM_MIN => 1,
ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
- )
+ ),
+ 'dir' => array(
+ ApiBase::PARAM_DFLT => 'ascending',
+ ApiBase::PARAM_TYPE => array(
+ 'ascending',
+ 'descending'
+ )
+ ),
);
}
'namespace' => 'The namespace to enumerate',
'limit' => 'How many total links to return',
'continue' => 'When more results are available, use this to continue',
+ 'dir' => 'The direction in which to list',
);
}