diff -u b/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php --- b/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -28,7 +28,7 @@ $form['#theme'] = array('comment_form__node_' . $node->type, 'comment_form'); $anonymous_contact = variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT); - $is_admin = (!empty($comment->id()) && user_access('administer comments')); + $is_admin = $comment->id() && user_access('administer comments'); if (!$user->uid && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT) { $form['#attached']['library'][] = array('system', 'jquery.cookie'); @@ -37,7 +37,7 @@ // If not replying to a comment, use our dedicated page callback for new // comments on nodes. - if (empty($comment->id()) && empty($comment->pid->value)) { + if (!$comment->id() && !$comment->pid->value) { $form['#action'] = url('comment/reply/' . $comment->nid->value); }