Fixes: U4-3820 cached media xml is not cleared from the cmsContentXml table when recycled
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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("__"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user