diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 007e5e3d8..c7eef20b8 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -390,7 +390,9 @@ $args->document_srl = $document_srl; $comments = executeQueryArray('comment.getAllComments',$args); if($comments->data) { + $commentSrlList = array(); foreach($comments->data as $key => $comment) { + array_push($commentSrlList, $comment->comment_srl); // call a trigger (before) $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); if(!$output->toBool()) continue; @@ -406,6 +408,15 @@ // Delete a list of comments $output = executeQuery('comment.deleteCommentsList', $args); + //delete declared, declared_log + if(is_array($commentSrlList) && count($commentSrlList)>0) + { + unset($args); + $args->comment_srl = join(',', $commentSrlList); + $tmpOutput1 = executeQuery('comment.deleteDeclaredComments', $args); + $tmpOutput2 = executeQuery('comment.deleteCommentDeclaredLog', $args); + } + return $output; } diff --git a/modules/comment/queries/deleteCommentDeclaredLog.xml b/modules/comment/queries/deleteCommentDeclaredLog.xml new file mode 100644 index 000000000..153caf2d4 --- /dev/null +++ b/modules/comment/queries/deleteCommentDeclaredLog.xml @@ -0,0 +1,8 @@ + + + + + + + +