From b11fe1033c69d48335c76370bb124247bbaf494f Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Thu, 15 Jul 2010 22:44:28 -0700 Subject: [PATCH] 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 --- .../Core/Contents/Controllers/AdminController.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index 1554e30c4..3d04e14e8 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -114,17 +114,14 @@ namespace Orchard.Core.Contents.Controllers { var contentItem = _contentManager.New(model.Id); model.Content = _contentManager.UpdateEditorModel(contentItem, this); - if (ModelState.IsValid) { - _contentManager.Create(contentItem, VersionOptions.Draft); - model.Content = _contentManager.UpdateEditorModel(contentItem, this); - } - if (!ModelState.IsValid) { _transactionManager.Cancel(); PrepareEditorViewModel(model.Content); return View("Create", model); } + _contentManager.Create(contentItem, VersionOptions.Draft); + //need to go about this differently - to know when to publish (IPlublishableAspect ?) if (!contentItem.Has()) _contentManager.Publish(contentItem);