Fix #1625 failure to preserve comment with children when parent is moved to trash

This commit is contained in:
Kijin Sung 2021-02-22 22:00:41 +09:00
parent 0188bb817b
commit 4fe083b3c7
2 changed files with 13 additions and 13 deletions

View file

@ -1266,7 +1266,15 @@ class commentController extends comment
if($updateComment !== true)
{
$output = executeQuery('comment.deleteComment', $trash_args);
$args = new stdClass;
$args->comment_srl = $obj->comment_srl;
$output = executeQuery('comment.deleteComment', $args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
$output = executeQuery('comment.deleteCommentList', $args);
if(!$output->toBool())
{
$oDB->rollback();
@ -1274,10 +1282,6 @@ class commentController extends comment
}
}
$args = new stdClass();
$args->comment_srl = $obj->comment_srl;
$output = executeQuery('comment.deleteCommentList', $args);
// update the number of comments
$comment_count = CommentModel::getCommentCount($obj->document_srl);