Skip to content

Commit

Permalink
Need to delete comment likes before deleting the comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
denny committed Jan 22, 2012
1 parent 9612eac commit 7f08fbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ShinyCMS/Controller/Discussion.pm
Expand Up @@ -437,6 +437,7 @@ sub delete_comment : Chained( 'base' ) : PathPart( 'delete' ) : Args( 1 ) {

# Delete any child comments, then the comment itself
$self->delete_comment_tree( $c, $comment_id );
$comment->comments_like->delete;
$comment->delete;

# Bounce back to the discussion location
Expand Down Expand Up @@ -484,7 +485,8 @@ sub delete_comment_tree {
});
while ( my $comment = $comments->next ) {
$self->delete_comment_tree( $c, $comment->id );
$comments->delete;
$comment->comments_like->delete;
$comment->delete;
}
}

Expand Down

0 comments on commit 7f08fbc

Please sign in to comment.