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

@ -593,15 +593,12 @@ class boardController extends board
}
// generate comment controller object
$oCommentController = getController('comment');
$updateComment = false;
if($this->module_info->comment_delete_message === 'yes' && $instant_delete != 'Y')
{
$output = $oCommentController->updateCommentByDelete($comment, $this->grant->manager);
$updateComment = true;
if($this->module_info->trash_use == 'Y')
{
$output = $oCommentController->moveCommentToTrash($comment, $updateComment);
$output = $oCommentController->moveCommentToTrash($comment, true);
}
}
elseif(starts_with('only_comm', $this->module_info->comment_delete_message) && $instant_delete != 'Y')
@ -610,17 +607,16 @@ class boardController extends board
if(count($childs) > 0)
{
$output = $oCommentController->updateCommentByDelete($comment, $this->grant->manager);
$updateComment = true;
if($this->module_info->trash_use == 'Y')
{
$output = $oCommentController->moveCommentToTrash($comment, $updateComment);
$output = $oCommentController->moveCommentToTrash($comment, true);
}
}
else
{
if($this->module_info->trash_use == 'Y')
{
$output = $oCommentController->moveCommentToTrash($comment, $updateComment);
$output = $oCommentController->moveCommentToTrash($comment);
}
else
{
@ -636,7 +632,7 @@ class boardController extends board
{
if($this->module_info->trash_use == 'Y')
{
$output = $oCommentController->moveCommentToTrash($comment, $this->module_info->comment_delete_message);
$output = $oCommentController->moveCommentToTrash($comment);
}
else
{