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

work item: 17650

--HG--
branch : 1.x
This commit is contained in:
Nathan Heskew
2011-04-05 13:10:23 -07:00
parent 6abd7f2efe
commit dd210ab801

View File

@@ -344,8 +344,9 @@ namespace Orchard.Widgets.Controllers {
if (widgetPart == null)
return HttpNotFound();
widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
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.