diff --git a/core/modules/comment/lib/Drupal/comment/CommentAccessController.php b/core/modules/comment/lib/Drupal/comment/CommentAccessController.php index 35d92c3..da957d2 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentAccessController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentAccessController.php @@ -36,6 +36,10 @@ public function createAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAU * Overrides \Drupal\Core\Entity\EntityAccessController::updateAccess(). */ public function updateAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + // If no user is specified fill in the current one. + if (!isset($account)) { + $account = $GLOBALS['user']; + } return ($account->uid && $account->id() == $entity->uid && $entity->status == COMMENT_PUBLISHED && user_access('edit own comments', $account)) || user_access('administer comments', $account); }