Loading core/includes/entity.inc +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading core/modules/field_ui/src/Tests/ManageDisplayTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -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.'); Loading core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading @@ -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); } Loading core/modules/image/src/Entity/ImageStyle.php +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading
core/includes/entity.inc +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
core/modules/field_ui/src/Tests/ManageDisplayTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -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.'); Loading
core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading
core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading @@ -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); } Loading
core/modules/image/src/Entity/ImageStyle.php +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading