Adding missing dynamic object casts.

--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-01-12 18:18:32 -08:00
parent 55e2bd15db
commit 4013fe539d
3 changed files with 16 additions and 8 deletions

View File

@@ -79,7 +79,8 @@ namespace Orchard.Blogs.Controllers {
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
conditionallyPublish(blogPost.ContentItem);
@@ -151,7 +152,8 @@ namespace Orchard.Blogs.Controllers {
var model = Services.ContentManager.UpdateEditor(blogPost, this);
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
conditionallyPublish(blogPost.ContentItem);

View File

@@ -72,7 +72,8 @@ namespace Orchard.Experimental.Controllers {
// get at the first input?
model.Fieldsets[0][0].Attributes(new {autofocus = "autofocus"}); // <-- could be applied by some other behavior - need to be able to modify attributes instead of clobbering them like this
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
[HttpPost, ActionName("FormShapes")]
@@ -104,7 +105,8 @@ namespace Orchard.Experimental.Controllers {
ViewBag.Page.Messages.Add(new HtmlString("<hr/>abuse<hr/>"));
ViewBag.Page.Messages.Add("<hr/>encoded<hr/>");
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
public static string Break(dynamic view) {

View File

@@ -134,7 +134,8 @@ namespace Orchard.Widgets.Controllers {
var model = Services.ContentManager.UpdateEditor(widgetPart, this);
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
Services.Notifier.Information(T("Your {0} has been created.", widgetPart.TypeDefinition.DisplayName));
@@ -179,7 +180,8 @@ namespace Orchard.Widgets.Controllers {
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
Services.Notifier.Information(T("Your {0} has been created.", layerPart.TypeDefinition.DisplayName));
@@ -226,7 +228,8 @@ namespace Orchard.Widgets.Controllers {
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
Services.Notifier.Information(T("Your {0} has been saved.", layerPart.TypeDefinition.DisplayName));
@@ -297,7 +300,8 @@ namespace Orchard.Widgets.Controllers {
var model = Services.ContentManager.UpdateEditor(widgetPart, this);
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
}
Services.Notifier.Information(T("Your {0} has been saved.", widgetPart.TypeDefinition.DisplayName));