Fixes: U4-3820 cached media xml is not cleared from the cmsContentXml table when recycled

This commit is contained in:
Shannon
2013-12-09 16:35:12 +11:00
parent 1b1ec04e7c
commit f15682ef60
2 changed files with 8 additions and 2 deletions

View File

@@ -526,13 +526,19 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
{
//Remove 'published' xml from the cmsContentXml table for the unpublished media
uow.Database.Delete<ContentXmlDto>("WHERE nodeId = @Id", new { Id = media.Id });
media.ChangeTrashedState(true, -21);
repository.AddOrUpdate(media);
//Loop through descendants to update their trash state, but ensuring structure by keeping the ParentId
foreach (var descendant in descendants)
{
//Remove 'published' xml from the cmsContentXml table for the unpublished media
uow.Database.Delete<ContentXmlDto>("WHERE nodeId = @Id", new { Id = descendant.Id });
descendant.ChangeTrashedState(true, descendant.ParentId);
repository.AddOrUpdate(descendant);
}

View File

@@ -529,7 +529,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
IPublishedProperty property = null;
// must ignore that one
if (i.Key == "version") continue;
if (i.Key == "version" || i.Key == "isDoc") continue;
if (i.Key.InvariantStartsWith("__"))
{