From abaa7fbfffbde5553f661b6428631582b54e3291 Mon Sep 17 00:00:00 2001 From: ovclas Date: Tue, 12 Apr 2011 06:20:02 +0000 Subject: [PATCH] #19688263 delete declared comment data when comment delete git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8297 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/comment/comment.controller.php | 11 +++++++++++ modules/comment/queries/deleteCommentDeclaredLog.xml | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 modules/comment/queries/deleteCommentDeclaredLog.xml 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 @@ + + + + + + + +