From ea11a4d2c9248f5bd7df75ae4590e6a21fe620cd Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 6 Apr 2011 14:16:15 -0700 Subject: [PATCH] Ensuring the layer change when adding a widget overrides the persisted container ID from the CommonPart work item: 17671 --HG-- branch : 1.x --- .../Modules/Orchard.Widgets/Controllers/AdminController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 33082b2e8..66230d3c3 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -177,6 +177,8 @@ namespace Orchard.Widgets.Controllers { return HttpNotFound(); var model = Services.ContentManager.UpdateEditor(widgetPart, this); + // override the CommonPart's persisting of the current container + widgetPart.LayerPart = _widgetsService.GetLayer(layerId); if (!ModelState.IsValid) { Services.TransactionManager.Cancel(); // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.