mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix an issue with paginating queries which reverse vector ordering components
Summary: Ref T10188. If you issue certain queries which use reverse ordering (like "All tasks, oldest update to newest update") and then try to page forward, we build the paging clause without reversing the column order correctly. For example, the ordering of "oldest update to newest update" is "dateModified ASC, id ASC", so the second page should include an "id > X" query. Currently, this builds as "id < X" incorrectly instead. The cause of this is just a failure to re-reverse a reversing flag when constructing the paging clause. Test Plan: - Queried tasks by update, oldest to newest, with no grouping, etc. - Paged to second page. - After change, got a valid second page with a good query in the Services tab. - Made some other normal queries. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10188 Differential Revision: https://secure.phabricator.com/D15076
This commit is contained in:
parent
6ebe8db380
commit
358240b804
1 changed files with 6 additions and 0 deletions
|
@ -381,6 +381,12 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
|||
$column = $orderable[$key];
|
||||
$column['value'] = $value_map[$key];
|
||||
|
||||
// If the vector component is reversed, we need to reverse whatever the
|
||||
// order of the column is.
|
||||
if ($order->getIsReversed()) {
|
||||
$column['reverse'] = !idx($column, 'reverse', false);
|
||||
}
|
||||
|
||||
$columns[] = $column;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue