diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index c671bc2..5b70f42 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -322,7 +322,7 @@ function comment_permission() { * An array "page=X" if the page number is greater than zero; NULL otherwise. */ function comment_new_page_count($num_comments, $new_comments, ContentEntityInterface $entity, $field_name = 'comment') { - $instance = \Drupal::service('field.info')->getInstance($entity->getEntityTypeId(), $entity->bundle(), $field_name); + $instance = $entity->getFieldDefinition($field_name); $comments_per_page = $instance->getSetting('per_page'); if ($num_comments <= $comments_per_page) {