Comment service now fetches latest (instead of published) when deleting a comment.

This commit is contained in:
myates
2015-09-18 16:35:36 +10:00
parent 47133604c3
commit adbab55ffc

View File

@@ -120,7 +120,8 @@ namespace Orchard.Comments.Services {
}
public void DeleteComment(int commentId) {
_orchardServices.ContentManager.Remove(_orchardServices.ContentManager.Get<CommentPart>(commentId).ContentItem);
// Get latest because the comment may be unpublished if the anti-spam module has caught it
_orchardServices.ContentManager.Remove(_orchardServices.ContentManager.Get<CommentPart>(commentId, VersionOptions.Latest));
}
public bool CommentsDisabledForCommentedContent(int id) {