diff --git a/core/modules/field/tests/modules/field_test/field_test.routing.yml b/core/modules/field/tests/modules/field_test/field_test.routing.yml index 95a9e5d..e592b8c 100644 --- a/core/modules/field/tests/modules/field_test/field_test.routing.yml +++ b/core/modules/field/tests/modules/field_test/field_test.routing.yml @@ -1,6 +1,12 @@ field_test_entity_nested_form: - pattern: 'test-entity/nested/{entity_1}/{entity_2}' + path: 'test-entity/nested/{entity_1}/{entity_2}' defaults: _form: '\Drupal\field_test\Form\EntityNestedForm' requirements: _permission: 'administer entity_test content' + options: + parameters: + entity_1: + type: 'entity:entity_test' + entity_2: + type: 'entity:entity_test' diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Form/EntityNestedForm.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Form/EntityNestedForm.php index b07f8e9..4e7bf19 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Form/EntityNestedForm.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Form/EntityNestedForm.php @@ -10,6 +10,7 @@ use Drupal\Core\Form\FormBase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Core\Entity\EntityInterface; /** * Displays banned IP addresses. @@ -39,14 +40,12 @@ public function getFormID() { /** * {@inheritdoc} * - * @param int $entity_1 + * @param \Drupal\Core\Entity\EntityInterface $entity_1 * The first entity. - * @param int $entity_2 + * @param \Drupal\Core\Entity\EntityInterface $entity_2 * The second entity. */ - public function buildForm(array $form, array &$form_state, $entity_1 = NULL, $entity_2 = NULL) { - $entity_1 = entity_load('entity_test', $entity_1); - $entity_2 = entity_load('entity_test', $entity_2); + public function buildForm(array $form, array &$form_state, EntityInterface $entity_1 = NULL, EntityInterface $entity_2 = NULL) { module_load_include('entity.inc', 'field_test'); return field_test_entity_nested_form($form, $form_state, $entity_1, $entity_2); }