diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 7112f6d..ac3c330 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -14,10 +14,7 @@ */ function comment_uninstall() { // Remove the comment fields. - $fields = entity_load_multiple_by_properties('field_entity', array( - 'type' => 'comment', - 'include_deleted' => FALSE, - )); + $fields = entity_load_multiple_by_properties('field_entity', array('type' => 'comment')); foreach ($fields as $field) { entity_invoke_bundle_hook('delete', 'comment', $field->entity_type . '__' . $field->name); $field->delete(); diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index fc833b8..3816fc4 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -56,14 +56,12 @@ public function getParentEntityUri(CommentInterface $comment) { /** * {@inheritdoc} */ - public function getFields($entity_type) { - $info = $this->entityManager->getDefinition($entity_type); - if (!is_subclass_of($info['class'], '\Drupal\Core\Entity\ContentEntityInterface')) { + public function getFields($entity_type = NULL) { + $map = $this->getAllFields(); + if (!isset($map[$entity_type])) { return array(); } - - $map = $this->getAllFields(); - return isset($map[$entity_type]) ? $map[$entity_type] : array(); + return $map[$entity_type]; } /** diff --git a/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php index 1f091d9..84a3589 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); + public function getFields($entity_type = NULL); /** * Utility function to return all comment fields. diff --git a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php index ad1ec2e..60fd532 100644 --- a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php +++ b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php @@ -90,9 +90,6 @@ function testEmailField() { )) ->save(); - // Rebuild field info to check if email field still working. - field_sync_field_status(); - // Display creation form. $this->drupalGet('entity_test/add'); $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget found.'); @@ -109,14 +106,13 @@ function testEmailField() { preg_match('|entity_test/manage/(\d+)|', $this->url, $match); $id = $match[1]; $this->assertText(t('entity_test @id has been created.', array('@id' => $id))); - - if ($this->assertRaw($value)) { - // Verify that a mailto link is displayed. - $entity = entity_load('entity_test', $id); - $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full'); - $entity->content = field_attach_view($entity, $display); - $this->drupalSetContent(drupal_render($entity->content)); - $this->assertLinkByHref('mailto:test@example.com'); - } + $this->assertRaw($value); + + // Verify that a mailto link is displayed. + $entity = entity_load('entity_test', $id); + $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full'); + $entity->content = field_attach_view($entity, $display); + $this->drupalSetContent(drupal_render($entity->content)); + $this->assertLinkByHref('mailto:test@example.com'); } } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFieldDefaultValueTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFieldDefaultValueTest.php index d5271fc..7d61f3d 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFieldDefaultValueTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFieldDefaultValueTest.php @@ -69,9 +69,6 @@ function testEntityReferenceDefaultValue() { )); $this->instance->save(); - // Rebuild field info to check if entity_reference field still working. - field_sync_field_status(); - // Set created node as default_value. $instance_edit = array( 'default_value_input[' . $this->field->name . '][0][target_id]' => $referenced_node->getTitle() . ' (' .$referenced_node->id() . ')', diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index 5904ebe..5b1e81a 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -38,6 +38,7 @@ function field_info_cache_clear() { // Clear typed data definitions. \Drupal::typedData()->clearCachedDefinitions(); \Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions(); + \Drupal::service('config.factory')->reset(); Field::fieldInfo()->flush(); }