Skip to content
Snippets Groups Projects
Commit 3b0e0c5b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2024833 followup by claudiu.cristea: Adopt load() and loadMultiple() on...

Issue #2024833 followup by claudiu.cristea: Adopt load() and loadMultiple() on entity storage controllers.
parent 50ab0be6
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -455,8 +455,7 @@ function testEntityTranslationAPI() {
// Check that per-language defaults are properly populated.
$entity = $this->reloadEntity($entity);
$instance_id = implode('.', array($entity->entityType(), $entity->bundle(), $this->field_name));
$instances = $this->entityManager->getStorageController('field_instance')->loadMultiple(array($instance_id));
$instance = reset($instances);
$instance = $this->entityManager->getStorageController('field_instance')->load($instance_id);
$instance['default_value_function'] = 'entity_test_field_default_value';
$instance->save();
$translation = $entity->addTranslation($langcode2);
......
......@@ -91,11 +91,9 @@ protected function createUser($values = array(), $permissions = array()) {
* The reloaded entity.
*/
protected function reloadEntity(EntityInterface $entity) {
$ids = array($entity->id());
$controller = $this->entityManager->getStorageController($entity->entityType());
$controller->resetCache($ids);
$entities = $controller->loadMultiple($ids);
return reset($entities);
$controller->resetCache(array($entity->id()));
return $controller->load($entity->id());
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment