Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -76,17 +76,9 @@ |
77 | 77 | $this->addTables(array('page','categorylinks')); // must be in this order for 'USE INDEX' |
78 | 78 | // Not needed after bug 10280 is applied to servers |
79 | 79 | if($params['sort'] == 'timestamp') |
80 | | - { |
81 | 80 | $this->addOption('USE INDEX', 'cl_timestamp'); |
82 | | - // cl_timestamp will be added by addWhereRange() later |
83 | | - $this->addOption('ORDER BY', 'cl_to'); |
84 | | - } |
85 | 81 | else |
86 | | - { |
87 | | - $dir = ($params['dir'] == 'desc' ? ' DESC' : ''); |
88 | 82 | $this->addOption('USE INDEX', 'cl_sortkey'); |
89 | | - $this->addOption('ORDER BY', 'cl_to, cl_sortkey' . $dir . ', cl_from' . $dir); |
90 | | - } |
91 | 83 | |
92 | 84 | $this->addWhere('cl_from=page_id'); |
93 | 85 | $this->setContinuation($params['continue'], $params['dir']); |
— | — | @@ -94,6 +86,11 @@ |
95 | 87 | $this->addWhereFld('page_namespace', $params['namespace']); |
96 | 88 | if($params['sort'] == 'timestamp') |
97 | 89 | $this->addWhereRange('cl_timestamp', ($params['dir'] == 'asc' ? 'newer' : 'older'), $params['start'], $params['end']); |
| 90 | + else |
| 91 | + { |
| 92 | + $this->addWhereRange('cl_sortkey', ($params['dir'] == 'asc' ? 'newer' : 'older'), $params['startsortkey'], $params['endsortkey']); |
| 93 | + $this->addWhereRange('cl_from', ($params['dir'] == 'asc' ? 'newer' : 'older'), null, null); |
| 94 | + } |
98 | 95 | |
99 | 96 | $limit = $params['limit']; |
100 | 97 | $this->addOption('LIMIT', $limit +1); |
— | — | @@ -225,7 +222,9 @@ |
226 | 223 | ), |
227 | 224 | 'end' => array( |
228 | 225 | ApiBase :: PARAM_TYPE => 'timestamp' |
229 | | - ) |
| 226 | + ), |
| 227 | + 'startsortkey' => null, |
| 228 | + 'endsortkey' => null, |
230 | 229 | ); |
231 | 230 | } |
232 | 231 | |
— | — | @@ -238,6 +237,8 @@ |
239 | 238 | 'dir' => 'In which direction to sort', |
240 | 239 | 'start' => 'Timestamp to start listing from. Can only be used with cmsort=timestamp', |
241 | 240 | 'end' => 'Timestamp to end listing at. Can only be used with cmsort=timestamp', |
| 241 | + 'startsortkey' => 'Sortkey to start listing from. Can only be used with cmsort=sortkey', |
| 242 | + 'endsortkey' => 'Sortkey to end listing at. Can only be used with cmsort=sortkey', |
242 | 243 | 'continue' => 'For large categories, give the value retured from previous query', |
243 | 244 | 'limit' => 'The maximum number of pages to return.', |
244 | 245 | ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -339,6 +339,8 @@ |
340 | 340 | and patrolmarks right |
341 | 341 | * (bug 15985) acfrom and aifrom parameters didn't work when sorting in |
342 | 342 | descending order. |
| 343 | +* (bug 15995) Add cmstartsortkey and cmendsortkey parameters to |
| 344 | + list=categorymembers |
343 | 345 | |
344 | 346 | === Languages updated in 1.14 === |
345 | 347 | |