U4-8937 - ContentController.PostSort is not honouring the passed sorted ids.

Created by Matt Cheale 02 Sep 2016, 13:45:17 Updated by Sebastiaan Janssen 20 Feb 2017, 13:53:22

Tags: PR

Relates to: U4-8788

What did you do? Attempted to use contentResource.sort()

What did you expect to happen? Relevant nodes to have their SortOrder values updated according to the order of the idSortOrder.

What actually happened? Relevant nodes have their SortOrder updated but in the default order they come out the database.

The logic would appear to retrieve all the content from ContentService.GetByIds() but this doesn't ensure the returned order is equal to the order of the passed in parameter. I'll be submitting a pull request shortly once I have an issue number.


Shannon Deminick 05 Sep 2016, 09:35:54


Stephan 05 Sep 2016, 10:13:00

@Shandem it seems that the real issue is U4-8788 - should content service GetByIds return the items in the same order as the ids? should we sort in the controller or in the service (I'm not sure... in most cases we don't need to sort, so service might be overkill).

Matt Cheale 05 Sep 2016, 11:02:46

My gut feeling is that the service is overkill and that the heavy work is best kept in the write process.

Umbraco 26 Sep 2016, 12:08:12

Note: we'll fix GetByIds to return the items in the same order as the ids?

Stephan 06 Oct 2016, 06:16:06

Issue U4-8788 has been fixed and now the content service respect the IDs order in GetById, and so this issue is considered fixed as well.

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.5.1, 7.5.2

Due in version: 7.5.5

Sprint: Sprint 43

Story Points: