mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-20 07:23:59 +08:00
Re-fixes issue with AuditTrail.
The call to Create before UpdateEditor is important. See comments on #7747 and #6733
This commit is contained in:
parent
9c9ab75809
commit
b565ad039e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user