Closes T8041, Calendar query results should be ordered from first start date to last start date
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T8041: Order Calendar events by start date in the list view
- Commits
- Restricted Diffusion Commit
rP680e8fdfdb48: Calendar query results should be ordered from first start date to last start…
Open "Upcoming Events" in Calendar, verify that the event with the first start date is first and that events are ordered in ascending start dates.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/applications/calendar/query/PhabricatorCalendarEventQuery.php | ||
---|---|---|
46 | (3) After you remove 'unique' => true, you'll have to change this to array('start', 'id'); or it will complain that the order vector does not have a terminal unique column. | |
55 | (1) This should be 'int'. | |
56 | (2) This isn't unique, since two events can have the same exact start value. Labeling a non-unique column as unique will create problems when the edge of a page has objects with the same value on either side of it. For example, if the end of the first page has several events which start on May 3 at 12:00 AM, and the beginning of the second page also has several events which start on May 3 at 12:00 AM, the code will believe that it can exclude all of them (because it thinks the value is unique). It will generate a query like AND dateFrom > "May 3 at 12:00 AM" and skip all of the results on the second page. | |
58 | (4) After you change the vector to array('start', 'id'), you'll get an error about 'id' not being defined as an orderable column. You can fix that by including the 'id' definition from the parent class with + parent::getOrderableColumns(). | |
63–64 | (5) Finally, after making 'id' an orderable column, this will complain that the paging value map does not include a value for 'id'. Add 'id' => $event->getID() here to fix that. Then everything should work. |