mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Revert "Optimizing client forms validation"
This reverts commit 878f45ad86
.
This commit is contained in:
@@ -27,9 +27,11 @@ namespace Orchard.Comments.Controllers {
|
||||
return this.RedirectLocal(returnUrl, "~/");
|
||||
|
||||
var comment = Services.ContentManager.New<CommentPart>("Comment");
|
||||
Services.ContentManager.Create(comment, VersionOptions.Draft);
|
||||
|
||||
var editorShape = Services.ContentManager.UpdateEditor(comment, this);
|
||||
|
||||
|
||||
if (!ModelState.IsValidField("Comments.Author")) {
|
||||
Services.Notifier.Error(T("Name is mandatory and must have less than 255 chars"));
|
||||
}
|
||||
@@ -47,6 +49,7 @@ namespace Orchard.Comments.Controllers {
|
||||
}
|
||||
|
||||
if (ModelState.IsValid) {
|
||||
Services.ContentManager.Create(comment);
|
||||
|
||||
var commentPart = comment.As<CommentPart>();
|
||||
|
||||
@@ -55,8 +58,6 @@ namespace Orchard.Comments.Controllers {
|
||||
Services.TransactionManager.Cancel();
|
||||
return this.RedirectLocal(returnUrl, "~/");
|
||||
}
|
||||
|
||||
Services.ContentManager.Create(comment.ContentItem, VersionOptions.Published);
|
||||
|
||||
var commentsPart = Services.ContentManager.Get(commentPart.CommentedOn).As<CommentsPart>();
|
||||
|
||||
|
@@ -122,6 +122,8 @@ namespace Orchard.CustomForms.Controllers {
|
||||
if (!Services.Authorizer.Authorize(Permissions.CreateSubmitPermission(customForm.ContentType), contentItem, T("Couldn't create content")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if(customForm.SaveContentItem)
|
||||
_contentManager.Create(contentItem, VersionOptions.Draft);
|
||||
|
||||
var model = _contentManager.UpdateEditor(contentItem, this);
|
||||
|
||||
@@ -162,7 +164,6 @@ namespace Orchard.CustomForms.Controllers {
|
||||
|
||||
// save the submitted form
|
||||
if (customForm.SaveContentItem) {
|
||||
_contentManager.Create(contentItem, VersionOptions.Draft);
|
||||
conditionallyPublish(contentItem);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user