#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
This commit is contained in:
ovclas 2011-04-12 06:20:02 +00:00
parent ba9401bfcb
commit abaa7fbfff
2 changed files with 19 additions and 0 deletions

View file

@ -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;
}

View file

@ -0,0 +1,8 @@
<query id="deleteCommentDeclaredLog" action="delete">
<tables>
<table name="comment_declared_log" />
</tables>
<conditions>
<condition operation="in" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
</conditions>
</query>