diff --git a/core/includes/entity.inc b/core/includes/entity.inc index d48aa4eb274ff18e1a0c5c4b7a5561a58779e1ca..69a07d78fa763d07ee69a5ebd9642a4b561813b3 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -538,7 +538,7 @@ function entity_get_display($entity_type, $bundle, $view_mode) { */ function entity_get_form_display($entity_type, $bundle, $form_mode) { // Try loading the entity from configuration. - $entity_form_display = entity_load('entity_form_display', $entity_type . '.' . $bundle . '.' . $form_mode); + $entity_form_display = EntityFormDisplay::load($entity_type . '.' . $bundle . '.' . $form_mode); // If not found, create a fresh entity object. We do not preemptively create // new entity form display configuration entries for each existing entity type diff --git a/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/core/modules/field_ui/src/Tests/ManageDisplayTest.php index b13518640d6f881cfde99d19a7a8e9ce1e1c2e12..f0235598c5ffbde9024bd1bf89b33192fe353958 100644 --- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php @@ -261,7 +261,9 @@ public function testWidgetUI() { // Save the form to save the third party settings. $this->drupalPostForm(NULL, array(), t('Save')); \Drupal::entityManager()->clearCachedFieldDefinitions(); - $display = entity_load('entity_form_display', 'node.' . $this->type . '.default', TRUE); + $storage = $this->container->get('entity_type.manager')->getStorage('entity_form_display'); + $storage->resetCache(array('node.' . $this->type . '.default')); + $display = $storage->load('node.' . $this->type . '.default'); $this->assertEqual($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form'), 'foo'); $this->assertTrue(in_array('field_third_party_test', $display->calculateDependencies()->getDependencies()['module']), 'Form display does not have a dependency on field_third_party_test module.'); diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php index 67ad20fca0df72e0790026c906d1dc80096ed5fb..711be260fe423b3e583d71903dd8a0cf6a0cf96b 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php @@ -314,7 +314,7 @@ public function testDeleteBundle() { $type->delete(); $display = entity_load('entity_view_display', 'node.article.default'); $this->assertFalse((bool) $display); - $form_display = entity_load('entity_form_display', 'node.article.default'); + $form_display = EntityFormDisplay::load('node.article.default'); $this->assertFalse((bool) $form_display); } diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php index b66d29cd1f3f127854204b23a1ca9547964013c0..e38db7cbb73553c0a06d5b921ce8988b2801bf4d 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php @@ -158,7 +158,7 @@ public function testBaseFieldComponent() { $this->assertFalse(isset($data['hidden']['test_display_non_configurable'])); // Check that defaults are correctly filled when loading the display. - $display = entity_load('entity_form_display', $display->id()); + $display = EntityFormDisplay::load($display->id()); foreach ($expected as $field_name => $options) { $this->assertEqual($display->getComponent($field_name), $options); } @@ -168,7 +168,7 @@ public function testBaseFieldComponent() { $data['content']['test_display_non_configurable'] = $expected['test_display_non_configurable']; $data['content']['test_display_non_configurable']['weight']++; $config->setData($data)->save(); - $display = entity_load('entity_form_display', $display->id()); + $display = EntityFormDisplay::load($display->id()); foreach ($expected as $field_name => $options) { $this->assertEqual($display->getComponent($field_name), $options); } diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php index 731443528139feaebd2d615118c1252ade3692cd..86035de945bf767bb1e8e4c6f5cbeb2be9856a3d 100644 --- a/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -4,6 +4,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; +use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; use Drupal\Core\Routing\RequestHelper; @@ -146,7 +147,7 @@ protected static function replaceImageStyle(ImageStyleInterface $style) { } } } - foreach (entity_load_multiple('entity_form_display') as $display) { + foreach (EntityFormDisplay::loadMultiple() as $display) { foreach ($display->getComponents() as $name => $options) { if (isset($options['type']) && $options['type'] == 'image_image' && $options['settings']['preview_image_style'] == $style->getOriginalId()) { $options['settings']['preview_image_style'] = $style->id();