Turns out when we empty the recycle bin we weren't removing associated cmsTask info. This also adds a null check since a SingleOrDefault call can return null. I've only seen this cause a problem when there is corrupt data but it should still be checked.

This commit is contained in:
Shannon
2017-06-19 23:48:18 +10:00
parent 2654f9189f
commit 1f6f8df5b5
2 changed files with 7 additions and 3 deletions

View File

@@ -636,9 +636,12 @@ namespace Umbraco.Core.Persistence.Repositories
{
//In order to update the ContentVersion we need to retrieve its primary key id
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
contentVersionDto.Id = contentVerDto.Id;
Database.Update(contentVersionDto);
if (contentVerDto != null)
{
contentVersionDto.Id = contentVerDto.Id;
Database.Update(contentVersionDto);
}
Database.Update(dto);
}

View File

@@ -42,6 +42,7 @@ namespace Umbraco.Core.Persistence.Repositories
//Construct and execute delete statements for all trashed items by 'nodeObjectType'
var deletes = new List<string>
{
FormatDeleteStatement("cmsTask", "nodeId"),
FormatDeleteStatement("umbracoUser2NodeNotify", "nodeId"),
FormatDeleteStatement("umbracoUser2NodePermission", "nodeId"),
@"DELETE FROM umbracoAccessRule WHERE umbracoAccessRule.accessId IN (