diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 0068c2e72a..0f041fe484 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1131,6 +1131,15 @@ namespace Umbraco.Core.Services int i = 0; foreach (var content in items) { + //If the current sort order equals that of the content + //we don't need to update it, so just increment the sort order + //and continue. + if (content.SortOrder == i) + { + i++; + continue; + } + content.SortOrder = i; content.WriterId = userId; i++; diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs index 9f15f7f0cc..6bf14c1559 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -735,6 +735,15 @@ namespace Umbraco.Core.Services int i = 0; foreach (var media in items) { + //If the current sort order equals that of the media + //we don't need to update it, so just increment the sort order + //and continue. + if (media.SortOrder == i) + { + i++; + continue; + } + media.SortOrder = i; i++;