From b565ad039e588e7b14650f55065849553d664d8d Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 25 Jun 2017 23:11:54 +0200 Subject: [PATCH] Re-fixes issue with AuditTrail. The call to Create before UpdateEditor is important. See comments on #7747 and #6733 --- .../Modules/Orchard.Comments/Controllers/CommentController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs index 3c1341484..b7f5b8075 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs @@ -27,6 +27,7 @@ namespace Orchard.Comments.Controllers { return this.RedirectLocal(returnUrl, "~/"); var comment = Services.ContentManager.New("Comment"); + Services.ContentManager.Create(comment, VersionOptions.Draft); var editorShape = Services.ContentManager.UpdateEditor(comment, this); if (!ModelState.IsValidField("Comments.Author")) { @@ -46,7 +47,7 @@ namespace Orchard.Comments.Controllers { } if (ModelState.IsValid) { - Services.ContentManager.Create(comment, VersionOptions.Draft); + Services.ContentManager.Publish(comment.ContentItem); var commentPart = comment.As(); @@ -121,7 +122,6 @@ namespace Orchard.Comments.Controllers { if (siteSettings.NotificationEmail) { _commentService.SendNotificationEmail(commentPart); } - } else { Services.TransactionManager.Cancel();