diff --git a/core/modules/contact/contact.admin.inc b/core/modules/contact/contact.admin.inc index 32ddf71..d686009 100644 --- a/core/modules/contact/contact.admin.inc +++ b/core/modules/contact/contact.admin.inc @@ -8,21 +8,6 @@ use Drupal\contact\Plugin\Core\Entity\Category; /** - * Page callback: Lists contact categories. - * - * @return array - * A build array in the format expected by drupal_render(). - * - * @see contact_menu() - */ -function contact_category_list() { - drupal_set_title(t('Contact form categories')); - return Drupal::entityManager() - ->getListController('contact_category') - ->render(); -} - -/** * Page callback: Presents the category creation form. * * @return array diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 3ef1ce6..72b3ace 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -58,9 +58,9 @@ function contact_permission() { */ function contact_menu() { $items['admin/structure/contact'] = array( - 'title' => 'Contact form', + 'title' => 'Contact form categories', 'description' => 'Create a system contact form and set up categories for the form to use.', - 'page callback' => 'contact_category_list', + 'route_name' => 'contact_category_list', 'access arguments' => array('administer contact forms'), 'file' => 'contact.admin.inc', ); diff --git a/core/modules/contact/contact.routing.yml b/core/modules/contact/contact.routing.yml index 1f34937..e7cbbeb 100644 --- a/core/modules/contact/contact.routing.yml +++ b/core/modules/contact/contact.routing.yml @@ -4,3 +4,11 @@ contact_category_delete: _form: '\Drupal\contact\Form\DeleteForm' requirements: _permission: 'administer contact forms' + +contact_category_list: + pattern: 'admin/structure/contact' + defaults: + _content: '\Drupal\Core\Entity\Controller\EntityListController::listing' + entity_type: 'contact_category' + requirements: + _permission: 'administer contact forms'