diff --git a/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/core/lib/Drupal/Core/Entity/EntityStorageBase.php index b181bb4..5bcd4d9 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php @@ -339,6 +339,13 @@ public function delete(array $entities) { return; } + // Ensure that the entities are keyed by ID. + $keyed_entities = array(); + foreach ($entities as $entity) { + $keyed_entities[$entity->id()] = $entity; + } + + // Allow code to run before deleting. $entity_class = $this->entityClass; $entity_class::preDelete($this, $entities); diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php index ebbba4b..13f6e3c 100644 --- a/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -283,6 +283,7 @@ function assertAllowedValuesInput($input_string, $result, $message) { $this->assertText($result, $message); } else { + \Drupal::entityManager()->getStorage('field_storage_config')->resetCache(array()); $field_storage = FieldStorageConfig::loadByName('node', $this->field_name); $this->assertIdentical($field_storage->getSetting('allowed_values'), $result, $message); } diff --git a/core/modules/path/src/Tests/PathLanguageTest.php b/core/modules/path/src/Tests/PathLanguageTest.php index 929afff..f1d9b62 100644 --- a/core/modules/path/src/Tests/PathLanguageTest.php +++ b/core/modules/path/src/Tests/PathLanguageTest.php @@ -61,7 +61,7 @@ protected function setUp() { $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save')); // Reset cache. - \Drupal::entityManager()->getStorage('field_config')->resetCache(); + \Drupal::entityManager()->getStorage('field_storage_config')->resetCache(); $definitions = \Drupal::entityManager()->getFieldDefinitions('node', 'page'); $this->assertTrue($definitions['path']->isTranslatable(), 'Node path is translatable.'); $this->assertTrue($definitions['body']->isTranslatable(), 'Node body is translatable.');