Page MenuHomePhabricator

Collection items should be sorted by modified time not alphabetically.
Closed, InvalidPublic


  • 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.

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Gather.
Jdlrobson moved this task to Needs triage on the Gather board.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 10 2015, 11:44 PM
JKatzWMF moved this task from This Sprint to Must haves on the Gather board.Apr 16 2015, 6:13 PM
Jdlrobson set Security to None.Apr 21 2015, 3:15 PM
Jdlrobson edited a custom field.
Jdlrobson renamed this task from Collections should be sorted by modified time not alphabetically. to Collection items should be sorted by modified time not alphabetically..Apr 30 2015, 6:54 PM
Jdlrobson added a subscriber: Tgr.

@Tgr we'd need to add a new column to the gather_list_items table...

Tgr added a comment.Apr 30 2015, 9:17 PM

What's the point of having gli_order˙if we are going to sort chronologically?

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?

Tgr added a comment.May 6 2015, 2:45 PM

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...)

Tgr closed this task as Invalid.May 6 2015, 7:13 PM
Tgr claimed this task.

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.

Jdlrobson edited a custom field.
Jdlrobson moved this task from In Analysis to Done on the Gather Sprint Greatest Hits board.