#19062: Reverting change to fix the parameter binding

Work Item: 19062

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-27 10:09:20 -07:00
parent 9f209ec243
commit 7fcd924de3

View File

@@ -318,7 +318,7 @@ namespace Orchard.Widgets.Controllers {
[HttpPost, ActionName("EditWidget")] [HttpPost, ActionName("EditWidget")]
[FormValueRequired("submit.Save")] [FormValueRequired("submit.Save")]
public ActionResult EditWidgetSavePOST(int id, string returnUrl) { public ActionResult EditWidgetSavePOST(int id, [Bind(Prefix = "WidgetPart.LayerId")] int layerId, string returnUrl) {
if (!IsAuthorizedToManageWidgets()) if (!IsAuthorizedToManageWidgets())
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
@@ -329,7 +329,7 @@ namespace Orchard.Widgets.Controllers {
try { try {
var model = Services.ContentManager.UpdateEditor(widgetPart, this); var model = Services.ContentManager.UpdateEditor(widgetPart, this);
// override the CommonPart's persisting of the current container // override the CommonPart's persisting of the current container
widgetPart.LayerPart = _widgetsService.GetLayer(widgetPart.LayerId); widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
if (!ModelState.IsValid) { if (!ModelState.IsValid) {
Services.TransactionManager.Cancel(); Services.TransactionManager.Cancel();
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation. // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.