Updating Sort methods to skip items that hasn't been sorted

This commit is contained in:
Morten Christensen
2013-05-29 05:37:55 -02:00
parent 4a7ee52d63
commit 8e1c45e981
2 changed files with 18 additions and 0 deletions

View File

@@ -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++;

View File

@@ -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++;