diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 2e4d0a6..7112f6d 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -48,13 +48,13 @@ function comment_install() { function _comment_get_comment_fields() { $fields = entity_load_multiple_by_properties('field_entity', array( 'type' => 'comment', - 'include_inactive' => FALSE, + 'include_inactive' => TRUE, 'include_deleted' => FALSE, )); foreach ($fields as &$field) { $instances = entity_load_multiple_by_properties('field_instance', array( 'field_uuid' => $field->uuid, - 'include_inactive' => FALSE, + 'include_inactive' => TRUE, 'include_deleted' => FALSE, )); foreach ($instances as $instance) { diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index 3816fc4..fc833b8 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -56,12 +56,14 @@ public function getParentEntityUri(CommentInterface $comment) { /** * {@inheritdoc} */ - public function getFields($entity_type = NULL) { - $map = $this->getAllFields(); - if (!isset($map[$entity_type])) { + public function getFields($entity_type) { + $info = $this->entityManager->getDefinition($entity_type); + if (!is_subclass_of($info['class'], '\Drupal\Core\Entity\ContentEntityInterface')) { return array(); } - return $map[$entity_type]; + + $map = $this->getAllFields(); + return isset($map[$entity_type]) ? $map[$entity_type] : array(); } /** diff --git a/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php index 84a3589..1f091d9 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php @@ -38,7 +38,7 @@ public function getParentEntityUri(CommentInterface $comment); * * @see field_info_field_map() */ - public function getFields($entity_type = NULL); + public function getFields($entity_type); /** * Utility function to return all comment fields.