Fixed form redirect issue.

This fixes the issue where you would not stay on the same page after a model validation occurred.
This commit is contained in:
Sipke Schoorstra
2015-07-04 12:45:17 +02:00
parent 22fa33c06f
commit c8f2c27311

View File

@@ -39,7 +39,7 @@ namespace Orchard.DynamicForms.Controllers {
public ActionResult Submit(int contentId, string formName) {
var layoutPart = _layoutManager.GetLayout(contentId);
var form = _formService.FindForm(layoutPart, formName);
var urlReferrer = Request.UrlReferrer != null && Url.IsLocalUrl(Request.UrlReferrer.ToString()) ? Request.UrlReferrer.ToString() : "~/";
var urlReferrer = Request.UrlReferrer != null ? Request.UrlReferrer.LocalPath : "~/";
if (form == null) {
Logger.Warning("The specified form \"{0}\" could not be found.", formName);