Merge pull request #5833 from mjy78/issue/5829

[Fixes #5829] Cannot delete spam comment when viewing comment details
This commit is contained in:
Sébastien Ros
2015-09-21 13:02:32 -07:00

View File

@@ -120,7 +120,8 @@ namespace Orchard.Comments.Services {
} }
public void DeleteComment(int commentId) { 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).ContentItem);
} }
public bool CommentsDisabledForCommentedContent(int id) { public bool CommentsDisabledForCommentedContent(int id) {