mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Fixed potential widget orphans when deleting layout content.
This fixes the scenario where you have a layout with a widget element pointing to a widget content item, and the layout content item is being deleted. Doing so will now correctly invoke Remove on all elements within the layout content item being deleted.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Alias;
|
||||
using Orchard.Autoroute.Models;
|
||||
@@ -7,7 +8,6 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Layouts.Framework.Elements;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Layouts.Models;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Utility.Extensions;
|
||||
@@ -98,6 +98,7 @@ namespace Orchard.Layouts.Handlers {
|
||||
var elements = _layoutManager.LoadElements(part).ToList();
|
||||
var savingContext = new LayoutSavingContext {
|
||||
Content = part,
|
||||
Elements = new List<Element>(),
|
||||
RemovedElements = elements
|
||||
};
|
||||
_elementManager.Removing(savingContext);
|
||||
|
Reference in New Issue
Block a user