diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc index 8f140e3..d604ec1 100644 --- a/core/modules/field/tests/modules/field_test/field_test.entity.inc +++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc @@ -43,6 +43,9 @@ function field_test_entity_info_translatable($entity_type = NULL, $translatable /** * Form combining two separate entities. + * + * @deprecated Use \Drupal\field_test\Form\EntityNestedForm::buildForm() + * instead. */ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2) { // First entity. @@ -83,6 +86,9 @@ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2 /** * Validate handler for field_test_entity_nested_form(). + * + * @deprecated Use \Drupal\field_test\Form\EntityNestedForm::validateForm() + * instead. */ function field_test_entity_nested_form_validate($form, &$form_state) { $entity_1 = entity_create('entity_test', array( @@ -102,6 +108,9 @@ function field_test_entity_nested_form_validate($form, &$form_state) { /** * Submit handler for field_test_entity_nested_form(). + * + * @deprecated Use \Drupal\field_test\Form\EntityNestedForm::submitForm() + * instead. */ function field_test_entity_nested_form_submit($form, &$form_state) { $entity_1 = entity_create('entity_test', array( diff --git a/core/modules/field/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module index 3ab0c7e..3dad8d0 100644 --- a/core/modules/field/tests/modules/field_test/field_test.module +++ b/core/modules/field/tests/modules/field_test/field_test.module @@ -43,9 +43,7 @@ function field_test_menu() { $items = array(); $items['test-entity/nested/%entity_test/%entity_test'] = array( 'title' => 'Nested entity form', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('field_test_entity_nested_form', 2, 3), - 'access arguments' => array('administer entity_test content'), + 'route_name' => 'field_test_entity_nested_form', 'type' => MENU_NORMAL_ITEM, ); 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 new file mode 100644 index 0000000..95a9e5d --- /dev/null +++ b/core/modules/field/tests/modules/field_test/field_test.routing.yml @@ -0,0 +1,6 @@ +field_test_entity_nested_form: + pattern: 'test-entity/nested/{entity_1}/{entity_2}' + defaults: + _form: '\Drupal\field_test\Form\EntityNestedForm' + requirements: + _permission: 'administer entity_test content' 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 new file mode 100644 index 0000000..b07f8e9 --- /dev/null +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Form/EntityNestedForm.php @@ -0,0 +1,69 @@ +