Commit f0f5a2ef authored by xjm's avatar xjm

Issue #2851761 by MariaDenysyuk, andypost: Comment logs messages under both...

Issue #2851761 by MariaDenysyuk, andypost: Comment logs messages under both 'content' and 'comment' loggers; make it consistent
parent 88a87872
......@@ -358,7 +358,7 @@ public function save(array $form, FormStateInterface $form_state) {
$entity = $comment->getCommentedEntity();
$field_name = $comment->getFieldName();
$uri = $entity->urlInfo();
$logger = $this->logger('content');
$logger = $this->logger('comment');
if ($this->currentUser->hasPermission('post comments') && ($this->currentUser->hasPermission('administer comments') || $entity->{$field_name}->status == CommentItemInterface::OPEN)) {
$comment->save();
......
......@@ -116,7 +116,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
if ($form_state->getValue('confirm')) {
$this->commentStorage->delete($this->comments);
$count = count($form_state->getValue('comments'));
$this->logger('content')->notice('Deleted @count comments.', array('@count' => $count));
$this->logger('comment')->notice('Deleted @count comments.', array('@count' => $count));
drupal_set_message($this->formatPlural($count, 'Deleted 1 comment.', 'Deleted @count comments.'));
}
$form_state->setRedirectUrl($this->getCancelUrl());
......
......@@ -42,7 +42,7 @@ protected function getDeletionMessage() {
* {@inheritdoc}
*/
public function logDeletionMessage() {
$this->logger('content')->notice('Deleted comment @cid and its replies.', array('@cid' => $this->entity->id()));
$this->logger('comment')->notice('Deleted comment @cid and its replies.', array('@cid' => $this->entity->id()));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment