Fix #1928 댓글 자리 남김 + 삭제시 휴지통 이동 기능 동시 사용시 댓글 내용이 유실되는 문제 수정

This commit is contained in:
Kijin Sung 2022-07-03 00:15:10 +09:00
parent 1f9056fc08
commit ec51b64e78

View file

@ -911,7 +911,9 @@ class commentController extends comment
{
return new BaseObject(-1, 'msg_invalid_request');
}
$comment = getModel('comment')->getComment($obj->comment_srl);
// check if comment exists and permission is granted
$comment = CommentModel::getComment($obj->comment_srl);
if(!$comment->isExists())
{
return new BaseObject(-1, 'msg_not_founded');
@ -928,17 +930,6 @@ class commentController extends comment
return $output;
}
// check if comment exists and permission is granted
$comment = CommentModel::getComment($obj->comment_srl);
if(!$comment->isExists())
{
return new BaseObject(-1, 'msg_not_founded');
}
if(!$is_admin && !$comment->isGranted())
{
return new BaseObject(-1, 'msg_not_permitted');
}
// If the case manager to delete comments, it indicated that the administrator deleted.
$logged_info = Context::get('logged_info');
if($is_admin === true && $obj->member_srl !== $logged_info->member_srl)
@ -1197,7 +1188,7 @@ class commentController extends comment
function moveCommentToTrash($obj, $updateComment = false)
{
// check if comment exists and permission is granted
$oComment = CommentModel::getComment($obj->comment_srl);
$oComment = ($obj instanceof commentItem) ? $obj : CommentModel::getComment($obj->comment_srl);
if(!$oComment->isExists())
{
return new BaseObject(-1, 'msg_not_founded');