Compare commits

...

3 Commits

Author SHA1 Message Date
Sipke Schoorstra
b565ad039e Re-fixes issue with AuditTrail.
The call to Create before UpdateEditor is important.
See comments on #7747 and #6733
2017-06-25 23:11:54 +02:00
Sipke Schoorstra
9c9ab75809 Fixed a typo. 2017-06-25 16:59:01 +02:00
Sipke Schoorstra
121e335009 Removed second call to UpdateEditor.
The second call seems to be unnecessary, and cause an issue with the ReCaptchaPartDriver (submitting the solved captcha twice to Google).

Fixes #7747
2017-06-25 16:58:25 +02:00

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,8 +47,7 @@ namespace Orchard.Comments.Controllers {
}
if (ModelState.IsValid) {
Services.ContentManager.Create(comment, VersionOptions.Draft);
Services.ContentManager.UpdateEditor(comment, this);
Services.ContentManager.Publish(comment.ContentItem);
var commentPart = comment.As<CommentPart>();
@@ -66,7 +66,7 @@ namespace Orchard.Comments.Controllers {
if(replied != null) {
var repliedPart = replied.As<CommentPart>();
// what is the next position after the anwered comment
// what is the next position after the answered comment
if(repliedPart != null) {
// the next comment is the one right after the RepliedOn one, at the same level
var nextComment = _commentService.GetCommentsForCommentedContent(commentPart.CommentedOn)
@@ -122,7 +122,6 @@ namespace Orchard.Comments.Controllers {
if (siteSettings.NotificationEmail) {
_commentService.SendNotificationEmail(commentPart);
}
}
else {
Services.TransactionManager.Cancel();