Merge pull request #405 from ONLYOFFICE/bugfix/bug-53122

fixed bug 53122
This commit is contained in:
Alexey Bannov 2021-10-19 22:32:30 +03:00 committed by GitHub
commit 951593bbe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,6 +515,7 @@ namespace ASC.Files.Core.Data
var toInsert = FilesDbContext.Tree var toInsert = FilesDbContext.Tree
.Where(r => r.FolderId == toFolderId) .Where(r => r.FolderId == toFolderId)
.OrderBy(r => r.Level)
.ToList(); .ToList();
foreach (var subfolder in subfolders) foreach (var subfolder in subfolders)
@ -525,7 +526,7 @@ namespace ASC.Files.Core.Data
{ {
FolderId = subfolder.Key, FolderId = subfolder.Key,
ParentId = f.ParentId, ParentId = f.ParentId,
Level = f.Level + 1 Level = subfolder.Value + 1 + f.Level
}; };
FilesDbContext.AddOrUpdate(r => r.Tree, newTree); FilesDbContext.AddOrUpdate(r => r.Tree, newTree);
} }