diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php new file mode 100644 index 0000000..2f0e1a6 --- /dev/null +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php @@ -0,0 +1,43 @@ + language_default()->langcode, + )); + return entity_get_form($vocabulary); + } + +} diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index 0703071..52c4f7e 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -91,18 +91,6 @@ function taxonomy_overview_vocabularies_submit($form, &$form_state) { } /** - * Page callback: provides the vocabulary creation form. - */ -function taxonomy_vocabulary_add() { - $vocabulary = entity_create('taxonomy_vocabulary', array( - // Default the new vocabulary to the site's default language. This is the - // most likely default value until we have better flexible settings. - 'langcode' => language_default()->langcode, - )); - return entity_get_form($vocabulary); -} - -/** * Form builder for the taxonomy terms overview. * * Display a tree of all the terms in a vocabulary, with options to edit diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 2557008..9c01962 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -241,15 +241,6 @@ function taxonomy_menu() { 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, ); - $items['admin/structure/taxonomy/add'] = array( - 'title' => 'Add vocabulary', - 'page callback' => 'taxonomy_vocabulary_add', - 'access callback' => 'entity_page_create_access', - 'access arguments' => array('taxonomy_vocabulary'), - 'type' => MENU_LOCAL_ACTION, - 'file' => 'taxonomy.admin.inc', - ); - $items['taxonomy/term/%taxonomy_term'] = array( 'title' => 'Taxonomy term', 'title callback' => 'taxonomy_term_title', diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml new file mode 100644 index 0000000..874eaa7 --- /dev/null +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -0,0 +1,6 @@ +vocabulary_admin: + pattern: '/admin/structure/taxonomy/add' + defaults: + _content: '\Drupal\taxonomy\Controller\TaxonomyController::vocabularyAdd' + requirements: + _entity_page_create_access: 'taxonomy_vocabulary'