mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
@@ -117,12 +117,14 @@ namespace Orchard.CustomForms.Controllers {
|
||||
}
|
||||
|
||||
var customForm = form.As<CustomFormPart>();
|
||||
|
||||
var contentItem = _contentManager.New(customForm.ContentType);
|
||||
|
||||
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);
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
@@ -162,7 +164,6 @@ namespace Orchard.CustomForms.Controllers {
|
||||
|
||||
// save the submitted form
|
||||
if (customForm.SaveContentItem) {
|
||||
_contentManager.Create(contentItem);
|
||||
conditionallyPublish(contentItem);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user