mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +08:00
Fixed a bug in content creation where all of the handlers were being called twice
- had two UpdateEditorModel calls in the create action --HG-- branch : dev
This commit is contained in:
@@ -114,17 +114,14 @@ namespace Orchard.Core.Contents.Controllers {
|
|||||||
var contentItem = _contentManager.New(model.Id);
|
var contentItem = _contentManager.New(model.Id);
|
||||||
model.Content = _contentManager.UpdateEditorModel(contentItem, this);
|
model.Content = _contentManager.UpdateEditorModel(contentItem, this);
|
||||||
|
|
||||||
if (ModelState.IsValid) {
|
|
||||||
_contentManager.Create(contentItem, VersionOptions.Draft);
|
|
||||||
model.Content = _contentManager.UpdateEditorModel(contentItem, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
_transactionManager.Cancel();
|
_transactionManager.Cancel();
|
||||||
PrepareEditorViewModel(model.Content);
|
PrepareEditorViewModel(model.Content);
|
||||||
return View("Create", model);
|
return View("Create", model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_contentManager.Create(contentItem, VersionOptions.Draft);
|
||||||
|
|
||||||
//need to go about this differently - to know when to publish (IPlublishableAspect ?)
|
//need to go about this differently - to know when to publish (IPlublishableAspect ?)
|
||||||
if (!contentItem.Has<IPublishingControlAspect>())
|
if (!contentItem.Has<IPublishingControlAspect>())
|
||||||
_contentManager.Publish(contentItem);
|
_contentManager.Publish(contentItem);
|
||||||
|
Reference in New Issue
Block a user