Re-fixes issue with AuditTrail.

The call to Create before UpdateEditor is important.
See comments on #7747 and #6733
This commit is contained in:
Sipke Schoorstra 2017-06-25 23:11:54 +02:00
parent 9c9ab75809
commit b565ad039e

View File

@ -27,6 +27,7 @@ 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")) {
@ -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<CommentPart>();
@ -121,7 +122,6 @@ namespace Orchard.Comments.Controllers {
if (siteSettings.NotificationEmail) {
_commentService.SendNotificationEmail(commentPart);
}
}
else {
Services.TransactionManager.Cancel();