Open elit0451 opened 1 week ago
The same issue occurs when Moving the first item and adding a new one
Can I pick this one up ? I have been able to figure out why this is happening:
Initially we are removing the first item, which has a sortOrder of 0, and then adding a new item, here it looks like the SortOrderExists method returns false because it cant find any item with sortOrder as 0
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.5.1, 14.3.0, 15 RC
Bug summary
When new document nodes are created, they are always added as the last child. But in the case when you delete an item with
sortOrder
0, and add a new one, it will be added as the first item. It seems like this is caused by not recalculating thesortOrder
of the siblings when the first item is deleted. This means that the new node comes withsortOrder = 0
, which results in taking the position as the first item.Specifics
No response
Steps to reproduce
Use a simple content type and create the following tree structure in the Content section:
Home
Delete "Child 1"
Add "Child 4"
You can also use the content service and verify that the
sortOrder
property of each child doesn't reflect the correct value:Expected result / actual result
Extected:
Actual