diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index 7930e91..83b5c4d 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -269,7 +269,7 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) { if ($this->authenticatedCanPostComments) { // We cannot use drupal_get_destination() because these links // sometimes appear on /node and taxonomy listing pages. - if ($entity->$field_name->getFieldDefinition()->getSetting('form_location') == COMMENT_FORM_SEPARATE_PAGE) { + if ($entity->get($field_name)->getFieldDefinition()->getSetting('form_location') == COMMENT_FORM_SEPARATE_PAGE) { $destination = array('destination' => 'comment/reply/' . $entity->entityType() . '/' . $entity->id() . '/' . $field_name . '#comment-form'); } else {