Fixes U4-1828 by correctly incrementing the sortorder ... doh!

This commit is contained in:
Morten Christensen
2013-03-21 17:34:08 -01:00
parent d485c3da97
commit b4d5658d45
2 changed files with 3 additions and 3 deletions

View File

@@ -267,7 +267,7 @@ namespace Umbraco.Core.Persistence.Repositories
entity.Path = string.Concat(parent.Path, ",", entity.Id);
entity.Level = parent.Level + 1;
var maxSortOrder = Database.ExecuteScalar<int>("SELECT coalesce(max(sortOrder),0) FROM umbracoNode WHERE parentid = @ParentId", new { ParentId = entity.ParentId });
entity.SortOrder = maxSortOrder;
entity.SortOrder = maxSortOrder + 1;
}
var factory = new ContentFactory(NodeObjectTypeId, entity.Id);

View File

@@ -732,9 +732,9 @@ namespace Umbraco.Core.Services
if (Moving.IsRaisedEventCancelled(new MoveEventArgs<IContent>(content, parentId), this))
return;
content.WriterId = userId;
if (parentId == -1)
if (parentId == -1)
{
content.Path = string.Concat("-1,", content.Id);
content.Level = 1;