Ensuring the layer change when adding a widget overrides the persisted container ID from the CommonPart

work item: 17671

--HG--
branch : 1.x
This commit is contained in:
Nathan Heskew
2011-04-06 14:16:15 -07:00
parent 5f28ffaa86
commit ea11a4d2c9

View File

@@ -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.