Sort order in umbraco.config does not match that showin in the admin site
We've noticed a problem on our site whereby we were listing out the children of a node in a Razor macro and they were coming out in a different order to that shown in the admin site.
I had a look in umbraco.config and could see that this is also wrong (i.e. it's the same as the Razor macro).
Two nodes that are the wrong way round both share the same sortorder attribute (of 5) and the newest one (with the higher ID) is first in the XML before the other one. (Note this is also not alphabetical.)
I think I have reproduced the problem to some extent in the admin site as follows:
1. Easist thing is to firstly create a new node to use as a parent. (The doctype used seems to be irrelevant)
2. Create three child nodes - "one", "two" and "three" in that order underneath.
3. Look at the XML - the sort order for the nodes is 1, 2 and 3 respectively, as expected.
4. Now delete node "one" and create a new node "four".
5. In the admin site it shows up "two", "three" and "four" in that order.
6. In the XML the sort orders are shown as "2, 3 and 3". (I've also looked in the UmbracoNode table and it's the same)
I think this is suggesting that there are two bugs.
Firstly, the logic to calculate the sort order appears to be "count of nodes plus one" as opposed to "max sort order plus one".
Secondly, the secondary order should presumably be by node iD.
This is a bit of a problem for us because this part of the site enables users to create the last 5 items so they are encouraged to always delete the one at the top of the list.
We are using Umbraco 4.7.2 but we also tried creating a brand new site in Umbraco 4.8.1 and it's occurring there as well.
Sort order in umbraco.config does not match that showin in the admin site
We've noticed a problem on our site whereby we were listing out the children of a node in a Razor macro and they were coming out in a different order to that shown in the admin site.
I had a look in umbraco.config and could see that this is also wrong (i.e. it's the same as the Razor macro).
Two nodes that are the wrong way round both share the same sortorder attribute (of 5) and the newest one (with the higher ID) is first in the XML before the other one. (Note this is also not alphabetical.)
I think I have reproduced the problem to some extent in the admin site as follows:
1. Easist thing is to firstly create a new node to use as a parent. (The doctype used seems to be irrelevant)
2. Create three child nodes - "one", "two" and "three" in that order underneath.
3. Look at the XML - the sort order for the nodes is 1, 2 and 3 respectively, as expected.
4. Now delete node "one" and create a new node "four".
5. In the admin site it shows up "two", "three" and "four" in that order.
6. In the XML the sort orders are shown as "2, 3 and 3". (I've also looked in the UmbracoNode table and it's the same)
I think this is suggesting that there are two bugs.
Firstly, the logic to calculate the sort order appears to be "count of nodes plus one" as opposed to "max sort order plus one".
Secondly, the secondary order should presumably be by node iD.
This is a bit of a problem for us because this part of the site enables users to create the last 5 items so they are encouraged to always delete the one at the top of the list.
We are using Umbraco 4.7.2 but we also tried creating a brand new site in Umbraco 4.8.1 and it's occurring there as well.
I've created an issue for this here: http://issues.umbraco.org/issue/U4-708
Would it be possible for this one to get fixed? I presume it's not by design? (I can raise it through Confidence if needed.)
Thanks,
John
is working on a reply...