Umbraco-CMS icon indicating copy to clipboard operation
Umbraco-CMS copied to clipboard

Sort the children of a parent node after either deleting or moving a child node

Open manutdkid77 opened this issue 4 months ago • 1 comments

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.

manutdkid77 avatar Oct 18 '24 15:10 manutdkid77