Commit 017132eb authored by webchick's avatar webchick

Issue #1974492 by larowlan, jibran, disasm, tim-e, mdrummond, robeano,...

Issue #1974492 by larowlan, jibran, disasm, tim-e, mdrummond, robeano, nick_schuch, wamilton, effulgentsia, tim.plunkett: Convert taxonomy_overview_terms() to a Form Controller.
parent 45e492dc
......@@ -5,6 +5,7 @@
* Administrative page callbacks for the Forum module.
*/
use Drupal\taxonomy\Form\OverviewTerms;
use Drupal\taxonomy\Entity\Term;
/**
......@@ -22,7 +23,9 @@ function forum_overview($form, &$form_state) {
$vid = $config->get('vocabulary');
$vocabulary = entity_load('taxonomy_vocabulary', $vid);
$form = taxonomy_overview_terms($form, $form_state, $vocabulary);
// @todo temporary, will be fixed in http://drupal.org/node/1974210.
$overview = OverviewTerms::create(Drupal::getContainer());
$form = $overview->buildForm($form, $form_state, $vocabulary);
foreach (element_children($form['terms']) as $key) {
if (isset($form['terms'][$key]['#term'])) {
......@@ -50,7 +53,8 @@ function forum_overview($form, &$form_state) {
unset($form['actions']['reset_alphabetical']);
// The form needs to have submit and validate handlers set explicitly.
$form['#submit'] = array('taxonomy_overview_terms_submit'); // Use the existing taxonomy overview submit handler.
// Use the existing taxonomy overview submit handler.
$form['#submit'] = array(array($overview, 'submitForm'));
$form['terms']['#empty'] = t('No containers or forums available. <a href="@container">Add container</a> or <a href="@forum">Add forum</a>.', array('@container' => url('admin/structure/forum/add/container'), '@forum' => url('admin/structure/forum/add/forum')));
return $form;
}
This diff is collapsed.
......@@ -287,13 +287,9 @@ function taxonomy_menu() {
);
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary'] = array(
'route_name' => 'taxonomy_overview_terms',
'title callback' => 'entity_page_label',
'title arguments' => array(4),
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_overview_terms', 4),
'access callback' => 'entity_page_access',
'access arguments' => array(4, 'view'),
'file' => 'taxonomy.admin.inc',
);
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/list'] = array(
'title' => 'List',
......@@ -306,7 +302,6 @@ function taxonomy_menu() {
'access callback' => 'entity_page_access',
'access arguments' => array(4, 'update'),
'type' => MENU_LOCAL_TASK,
'file' => 'taxonomy.admin.inc',
);
$items['admin/structure/taxonomy/%taxonomy_vocabulary/delete'] = array(
'title' => 'Delete',
......
......@@ -53,3 +53,11 @@ taxonomy_autocomplete:
_controller: '\Drupal\taxonomy\Controller\TermAutocompleteController::autocomplete'
requirements:
_permission: 'access content'
taxonomy_overview_terms:
pattern: 'admin/structure/taxonomy/manage/{taxonomy_vocabulary}'
defaults:
_form: 'Drupal\taxonomy\Form\OverviewTerms'
requirements:
_entity_access: 'taxonomy_vocabulary.view'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment