diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 92f6223816..5e3d17c75d 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1215,6 +1215,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 91f90c0c99..292cb2ca8f 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -788,6 +788,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++;