Umbraco-CMS
Umbraco-CMS copied to clipboard
Sort the children of a parent node after either deleting or moving a child node
Prerequisites
- [x] I have added steps to test this contribution in the description below
This fixes #17273
Description
- When a new document
node A
is created under a parent node, it is assigned a SortOrder value of 0. - Now if you created another document
node B
under the parenr node, it is assigned a SortOrder value of 1. - Now delete
node A
- Create a new
node C
, here the SortOrderExists looks to find any item with sortOrder as 0. - But the
SortOrderExists
can't find such an item with SortOrder as 0, so it returns false, and this results in setting the SortOrder as 0 - My solution is to recalculate the Sort after deletion or move operation of a document node.