- I add Barack Obama to the 'President' list
- I add Theodore Roosevelt to the same list.
When I visit the 'President' list Theodore Roosevelt appears before Barack Obama as he was added afterwards.
When I visit the 'President' list Theodore Roosevelt appears before Barack Obama as he was added afterwards.
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Invalid | Tgr | T95786 Collection items should be sorted by modified time not alphabetically. | |||
| Duplicate | None | T94117 API: support page reordering | |||
| Resolved | Tgr | T95972 API: Change default ordering of page titles namespace | |||
| Resolved | Tgr | T98490 Add (list, title) index for Gather lists | |||
| Resolved | Tgr | T96904 PHPUnit tests do not get run by Jenkins for Gather commits |
In future we want to provide an interface was sorting arbitrarily. Right now the sorting seems random/nonexistent - not sure if gli_order or api is to blame for that. Alphabetical would at least be a logical interim.
Gli_order should reflect when added but currently it doesn't seem to unless I'm mistaken?
The code seems sane - new items get the last position. (It is vulnerable to race conditions, but a user racing with themselves to add items seems unlikely. Then again, if adding multiple items is implemented via parallel API calls, fired simultaneously...)
Did a bit of debugging. This is caused by a combination of T91017 (which seems to order results by title, not pageid as I stated elsewhere) and T98389. The result is that when viewing a list (API result gets rendered on the server), items are sorted alphabetically in the HTML code. (They are displayed in two columns, first top-to-bottom then left-to-right, and as a reader I try to parse them first left-to-right then top-to-bottom, so they look garbled but that's a CSS issue.) When editing a list (API result gets rendered on the client), sorting might be alphabetical or by pageid, depending on your browser.
Closing this bug; the listpages API already sorts chronologically, respecting the ordering used in the generator module is handled by the above mentioned bugs.