Fix issue - changing a document type broke the nucache data structure (#12209)
(cherry picked from commit 15df448274edb291ae568148c61baa7541615247)
This commit is contained in:
@@ -443,10 +443,18 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
refreshedIdsA.Contains(x.ContentTypeId) &&
|
||||
BuildKit(x, out _)))
|
||||
{
|
||||
// replacing the node: must preserve the parents
|
||||
// replacing the node: must preserve the relations
|
||||
var node = GetHead(_contentNodes, kit.Node.Id)?.Value;
|
||||
if (node != null)
|
||||
{
|
||||
// Preserve children
|
||||
kit.Node.FirstChildContentId = node.FirstChildContentId;
|
||||
kit.Node.LastChildContentId = node.LastChildContentId;
|
||||
|
||||
// Also preserve siblings
|
||||
kit.Node.NextSiblingContentId = node.NextSiblingContentId;
|
||||
kit.Node.PreviousSiblingContentId = node.PreviousSiblingContentId;
|
||||
}
|
||||
|
||||
SetValueLocked(_contentNodes, kit.Node.Id, kit.Node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user