}
// update counters
+ /** @var ICommentManager[] $processors */
$processors = [];
$groupCommentIDs = $commentIDs = [];
foreach ($this->getObjects() as $comment) {
$groupCommentIDs[$comment->objectTypeID] = [];
}
- $processors[$comment->objectTypeID]->updateCounter($comment->objectID, -1 * ($comment->responses + 1));
+ if (!$comment->isDisabled) {
+ $processors[$comment->objectTypeID]->updateCounter($comment->objectID, -1 * ($comment->responses + 1));
+ }
+
$groupCommentIDs[$comment->objectTypeID][] = $comment->commentID;
$commentIDs[] = $comment->commentID;
}
$comments = $commentList->getObjects();
// update counters
+ /** @var ICommentManager[] $processors */
$processors = $responseIDs = $updateComments = [];
foreach ($this->getObjects() as $response) {
$objectTypeID = $comments[$response->commentID]->objectTypeID;
}
$responseIDs[$objectTypeID][] = $response->responseID;
- if (!$ignoreCounters) {
+ if (!$ignoreCounters && !$response->isDisabled) {
$processors[$objectTypeID]->updateCounter($comments[$response->commentID]->objectID, -1);
if (!isset($updateComments[$response->commentID])) {
foreach ($comments as $comment) {
$commentEditor = new CommentEditor($comment);
$commentEditor->updateResponseIDs();
- $commentEditor->updateCounters([
- 'responses' => -1 * $updateComments[$comment->commentID]
- ]);
+ if (isset($updateComments[$comment->commentID])) {
+ $commentEditor->updateCounters([
+ 'responses' => -1 * $updateComments[$comment->commentID]
+ ]);
+ }
}
}