Commit 3b0e0c5b authored by alexpott's avatar alexpott
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
......@@ -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());
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment