From dac37ebf531ba3637087f9d0c578b1875a0392d2 Mon Sep 17 00:00:00 2001 From: ovclas Date: Tue, 12 Apr 2011 07:20:47 +0000 Subject: [PATCH] #19688372 delete voted comment log, when comment deleted git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8299 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/comment/comment.controller.php | 30 +++++++++++++++++-- .../comment/queries/deleteCommentVotedLog.xml | 8 +++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 modules/comment/queries/deleteCommentVotedLog.xml diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index c7eef20b8..ee56533b0 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -369,6 +369,9 @@ } } + $this->_deleteDeclaredComments($args); + $this->_deleteVotedComments($args); + // commit $oDB->commit(); @@ -408,18 +411,39 @@ // Delete a list of comments $output = executeQuery('comment.deleteCommentsList', $args); - //delete declared, declared_log + //delete declared, declared_log, voted_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); + $this->_deleteDeclaredComments($args); + $this->_deleteVotedComments($args); } return $output; } + /** + * @brief delete declared comment, log + * @param $commentSrls : srls string (ex: 1, 2,56, 88) + * @return void + **/ + function _deleteDeclaredComments($commentSrls) + { + executeQuery('comment.deleteDeclaredComments', $commentSrls); + executeQuery('comment.deleteCommentDeclaredLog', $commentSrls); + } + + /** + * @brief delete voted comment log + * @param $commentSrls : srls string (ex: 1, 2,56, 88) + * @return void + **/ + function _deleteVotedComments($commentSrls) + { + executeQuery('comment.deleteCommentVotedLog', $commentSrls); + } + /** * @brief Increase vote-up counts of the comment **/ diff --git a/modules/comment/queries/deleteCommentVotedLog.xml b/modules/comment/queries/deleteCommentVotedLog.xml new file mode 100644 index 000000000..06ac9b320 --- /dev/null +++ b/modules/comment/queries/deleteCommentVotedLog.xml @@ -0,0 +1,8 @@ + + + + + + + +