U4-6003 - List View - Order By Custom Property

Created by Lee M 11 Dec 2014, 15:59:05 Updated by Eric Wilkinson 08 Nov 2017, 15:56:40

Tags: PR

Relates to: U4-6523

Relates to: U4-8290

Relates to: U4-10653

Relates to: U4-4383

Relates to: U4-5990

It would be nice if we could sort by a custom property in the list view, I realise that some property values are not orderable. But if you showed only properties that are of core types that can be ordered (i.e. Textstring, Numeric etc...) then it would make the listview even more flexible.


Andy Butland 13 Dec 2014, 21:38:11

PR: https://github.com/umbraco/Umbraco-CMS/pull/711 (see comments on GitHub for details of approach taken)

andrew shearer 16 Jul 2015, 04:12:46

it would be really great if this pull request could be included in 7.3

Martin Griffiths 05 Aug 2015, 12:34:55

Its a bit odd there's been no movement on this for 7.3. Especially considering a fix has been submitted.

This one would be really useful for me in the core.


Sebastiaan Janssen 05 Aug 2015, 13:26:22

It would be. But we also have to make choices and this is a big one which unfortunately requires more time to test and look into than we can handle for 7.3.0. We'll reconsider for 7.4 which should come out by the end of the fall.

Martin Griffiths 05 Aug 2015, 14:13:05

Thanks for the info. It's nice to know its at least on the horizon

andrew shearer 31 Aug 2015, 23:56:54

hello - i can't see 7.4 scheduled on https://our.umbraco.org/contribute/progress Do you mean this could be due in 8? thanks

Sebastiaan Janssen 01 Sep 2015, 06:40:08

7.4 is there now

Ryan Lewis 13 Jan 2016, 15:08:43

Just checked the 7.4 beta. Is this going to make it to final?

Cristiano Martins 23 Feb 2016, 11:47:34

It's with a bit of disappointment that I see that this is still not scheduled to be included in any future release The current one in progress is 7.4.2, and I can't find any mention of this.

I've applied the submitted fix in 7.2.8, but the fix is not applicable any more in 7.4, because there's some big changes in the source code, meanwhile I'm stuck in 7.2.8 and can't move to any latest release, since this is a critical feature for me.

Looking forward for any updates regarding this.


Asbjørn Riis-Knudsen 24 Feb 2016, 16:16:08

Would love to see this soon as well. The listview is not really complete without this feature. It is kind of sad that the PR has sat without any action for over a year...

Martin Griffiths 08 Mar 2016, 09:43:03

The votes for this one keep on rising!

andrew shearer 16 Mar 2016, 03:47:24

would be cool if features were included in the next release depending on how many votes they have. This would be right up there for sure!

Martin Griffiths 30 Mar 2016, 12:59:24

Whoop! Sprint 12

Shannon Deminick 06 Apr 2016, 11:32:56

For the Core reviewers:

  • Originally I had said this had breaking changes due to potential API breaking changes but I've made them backwards compat. The interfaces to review are: IContentService, IMemberService, IMediaService. The PR originally adds an optional parameter to an already existing methods (= breaking API usages). We cannot simply add another overloaded method with the same signature and another optional parameter because then we will get ambiguous method call exceptions since they overlap. So I've made the new methods that does the sorting of custom fields (contains the orderBySystemField parameter) overloads with zero optional parameters, this way the existing method will continue to work, there are not API usage breaks and we will not get ambiguous method call exceptions
  • I've reviewed the other code submitted by the community but feel free to skim over it to see that you see no issues with it
  • Ensure that you can add a custom field to list views in content, media and members and ensure you can sort on them
  • Be sure no unit tests are breaking
  • Be sure you get no YSODs of any sort based on code from an existing site - maybe try installing and using some common/popular starter kit type packages

Shannon Deminick 06 Apr 2016, 11:33:35

PR is here: https://github.com/umbraco/Umbraco-CMS/pull/1216 for when we are ready for 7.5 - DO NOT PULL this in until after 7.4.3 is released, just marked this as Fixed.

Warren Buckley 07 Apr 2016, 08:19:18

@Shandem I can't review this as seems like it needs further attention from you, as Andy B has further SQL changes that may need looking at first before this can be reviewed over on the GitHub PR -https://github.com/umbraco/Umbraco-CMS/pull/1216#issuecomment-206732382

Shannon Deminick 07 Apr 2016, 08:45:37

@warren.buckley go ahead and review mate, no need to worry about what Andy is mentioning there.

Claus Jensen 12 Apr 2016, 13:42:57

I've reviewed this one in both functionality and code and it looks good.

I added in a few fixes but apart from that it all looks good to merge in 7.5:

  • Name column wasn't marked as isSystem so sorting by this didn't work.
  • OrderDirection was reversed every time you switched OrderBy - it should only reverse itself when clicking the same column as you are currently ordering by.

@Shandem: Marking this as fixed - do we have a way of keeping track of it so we remember to merge in 7.5?

Claus Jensen 12 Apr 2016, 13:43:45

This is my commit btw: https://github.com/umbraco/Umbraco-CMS/pull/1216/commits/76054bb78338c9997bbf63c5e6821f15151e2044

Shannon Deminick 12 Apr 2016, 14:06:48

Great testing!! I'll maybe change this branch name to just be 7.5 since i have some other stuff that can only be included in 7.5 too. Once 7.4.3 is out then we'll make dev-v7 7.5

Shannon Deminick 14 Apr 2016, 13:51:41

@abutland any chance you tested this with SqlCe? Far as I can tell this will not work with SqlCe since it doesn't seem to support sub queries inside of Order By.

Andy Butland 14 Apr 2016, 14:05:58

Ah... no, afraid not, SQL Express only. Sorry, I hadn't realised that restriction of CE.

Looks like you are correct though, see here: http://docs.telerik.com/data-access/developers-guide/database-specifics/database-specifics-sqlce-overview - "Microsoft SQL CE comes with a few restrictions in comparison with the other databases. The most important of them are ... SQL queries that use a subquery as a scalar expression in the WHERE clause", which is what we are doing here.

Shannon Deminick 14 Apr 2016, 14:22:42

Yup, so the subquery and also some of the sql methods are not supported. I'm refactoring it to use an inner join on a temp table instead which might end up being better for performance anyways... not sure how I'll do the changes to the SQL methods yet. I've also improved performance because we don't need the sub sub sub query to get the latest version (that is already stored in a column in the db: 'newest')

John Churchley 28 Jul 2016, 09:01:13

Hi I've reported the issue separately (U4-8779) but this doesn't work for columns in the Members Listview.

Damien 07 Mar 2017, 20:47:14

Hi, is the List View order by custom property functionality intended to sort decimal doc type values? I am currently seeing incorrect sorting in 7.5.11? using both custom sort and sorting by column header click on decimal values.

Priority: Normal

Type: Feature (request)

State: Fixed


Difficulty: Normal

Category: Extensibility

Backwards Compatible: False

Fix Submitted: Pull request

Affected versions:

Due in version: 7.5.0

Sprint: Sprint 13

Story Points: