mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Fixing validation messages not displayed when using ShapeResult
--HG-- branch : 1.x
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Orchard.Users.Controllers {
|
||||
if (currentUser == null) {
|
||||
Logger.Information("Access denied to anonymous request on {0}", returnUrl);
|
||||
var shape = _orchardServices.New.LogOn().Title(T("Access Denied").Text);
|
||||
return new ShapeResult(shape);
|
||||
return new ShapeResult(this, shape);
|
||||
}
|
||||
|
||||
//TODO: (erikpo) Add a setting for whether or not to log access denieds since these can fill up a database pretty fast from bots on a high traffic site
|
||||
@@ -59,7 +59,7 @@ namespace Orchard.Users.Controllers {
|
||||
return Redirect("~/");
|
||||
|
||||
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
||||
return new ShapeResult(shape);
|
||||
return new ShapeResult(this, shape);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@@ -69,7 +69,7 @@ namespace Orchard.Users.Controllers {
|
||||
var user = ValidateLogOn(userNameOrEmail, password);
|
||||
if (!ModelState.IsValid) {
|
||||
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
||||
return new ShapeResult(shape);
|
||||
return new ShapeResult(this, shape);
|
||||
}
|
||||
|
||||
_authenticationService.SignIn(user, false);
|
||||
|
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace Orchard.Mvc {
|
||||
public class ShapeResult : ViewResult {
|
||||
public ShapeResult(dynamic shape) {
|
||||
public ShapeResult(ControllerBase controller, dynamic shape) {
|
||||
ViewData = controller.ViewData;
|
||||
TempData = controller.TempData;
|
||||
ViewData.Model = shape;
|
||||
ViewName = "~/Core/Shapes/Views/ShapeResult/Display.cshtml";
|
||||
}
|
||||
|
Reference in New Issue
Block a user