diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php index 2287e6c..44eb616 100644 --- a/core/modules/field/lib/Drupal/field/FieldInfo.php +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php @@ -161,6 +161,9 @@ public function flush() { $this->bundleExtraFields = array(); $this->cacheBackend->deleteTags(array('field_info' => TRUE)); + + \Drupal::entityManager()->getStorageController('field_entity')->resetCache(); + \Drupal::entityManager()->getStorageController('field_instance')->resetCache(); } /** diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index 8007139..003b60a 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -70,9 +70,6 @@ function setUp() { // Ensure configuration changes are picked up in the host environment. Field::fieldInfo()->flush(); - // Reset cache. - \Drupal::entityManager()->getStorageController('node')->resetCache(); - $field = Field::fieldInfo()->getField('node', 'body'); $this->assertTrue($field->isFieldTranslatable(), 'Node body is translatable.'); } @@ -89,9 +86,6 @@ function testAliasTranslation() { $edit['path[alias]'] = $english_alias; $this->drupalPostForm('node/' . $english_node->id() . '/edit', $edit, t('Save')); - // Reset cache. - \Drupal::entityManager()->getStorageController('node')->resetCache(); - // Confirm that the alias works. $this->drupalGet($english_alias); $this->assertText($english_node->body->value, 'Alias works.'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php index 9aab0c8..14afd69 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php @@ -147,6 +147,7 @@ public function testUICRUD() { $this->drupalPostForm(NULL, array(), t('Apply')); $this->drupalPostForm(NULL, array(), t('Save')); + $this->container->get('entity.manager')->getStorageController('view')->resetCache(); $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertTrue(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was added to the view itself.');