diff --git a/core/modules/path/lib/Drupal/path/Controller/PathController.php b/core/modules/path/lib/Drupal/path/Controller/PathController.php
new file mode 100644
index 0000000..165c667
--- /dev/null
+++ b/core/modules/path/lib/Drupal/path/Controller/PathController.php
@@ -0,0 +1,114 @@
+ :langcode', 0, 1, array(':langcode' => LANGUAGE_NOT_SPECIFIED))->fetchField();
+ $multilanguage = (module_exists('language') || $alias_exists);
+
+ $header = array();
+ $header[] = array('data' => t('Alias'), 'field' => 'alias', 'sort' => 'asc');
+ $header[] = array('data' => t('System'), 'field' => 'source');
+ if ($multilanguage) {
+ $header[] = array('data' => t('Language'), 'field' => 'langcode');
+ }
+ $header[] = t('Operations');
+
+ $query = db_select('url_alias')
+ ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+ ->extend('Drupal\Core\Database\Query\TableSortExtender');
+ if ($keys) {
+ // Replace wildcards with PDO wildcards.
+ $query->condition('alias', '%' . preg_replace('!\*+!', '%', $keys) . '%', 'LIKE');
+ }
+ $result = $query
+ ->fields('url_alias')
+ ->orderByHeader($header)
+ ->limit(50)
+ ->execute();
+
+ $rows = array();
+ $destination = drupal_get_destination();
+ foreach ($result as $data) {
+ $row = array();
+ $row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
+ 'attributes' => array('title' => $data->alias),
+ ));
+ $row['data']['source'] = l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array(
+ 'alias' => TRUE,
+ 'attributes' => array('title' => $data->source),
+ ));
+ if ($multilanguage) {
+ $row['data']['language_name'] = language_name($data->langcode);
+ }
+
+ $operations = array();
+ $operations['edit'] = array(
+ 'title' => t('edit'),
+ 'href' => "admin/config/search/path/edit/$data->pid",
+ 'query' => $destination,
+ );
+ $operations['delete'] = array(
+ 'title' => t('delete'),
+ 'href' => "admin/config/search/path/delete/$data->pid",
+ 'query' => $destination,
+ );
+ $row['data']['operations'] = array(
+ 'data' => array(
+ '#type' => 'operations',
+ '#links' => $operations,
+ ),
+ );
+
+ // If the system path maps to a different URL alias, highlight this table
+ // row to let the user know of old aliases.
+ if ($data->alias != drupal_container()->get('path.alias_manager')->getPathAlias($data->source, $data->langcode)) {
+ $row['class'] = array('warning');
+ }
+
+ $rows[] = $row;
+ }
+
+ $build['path_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#empty' => t('No URL aliases available. Add URL alias.', array('@link' => url('admin/config/search/path/add'))),
+ );
+ $build['path_pager'] = array('#theme' => 'pager');
+
+ return $build;
+ }
+
+}
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index 773431c..b62bfde 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -6,94 +6,6 @@
*/
/**
- * Returns a listing of all defined URL aliases.
- *
- * When filter key passed, perform a standard search on the given key,
- * and return the list of matching URL aliases.
- */
-function path_admin_overview($keys = NULL) {
- // Add the filter form above the overview table.
- $build['path_admin_filter_form'] = drupal_get_form('path_admin_filter_form', $keys);
- // Enable language column if language.module is enabled or if we have any
- // alias with a language.
- $alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE langcode <> :langcode', 0, 1, array(':langcode' => LANGUAGE_NOT_SPECIFIED))->fetchField();
- $multilanguage = (module_exists('language') || $alias_exists);
-
- $header = array();
- $header[] = array('data' => t('Alias'), 'field' => 'alias', 'sort' => 'asc');
- $header[] = array('data' => t('System'), 'field' => 'source');
- if ($multilanguage) {
- $header[] = array('data' => t('Language'), 'field' => 'langcode');
- }
- $header[] = t('Operations');
-
- $query = db_select('url_alias')
- ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
- ->extend('Drupal\Core\Database\Query\TableSortExtender');
- if ($keys) {
- // Replace wildcards with PDO wildcards.
- $query->condition('alias', '%' . preg_replace('!\*+!', '%', $keys) . '%', 'LIKE');
- }
- $result = $query
- ->fields('url_alias')
- ->orderByHeader($header)
- ->limit(50)
- ->execute();
-
- $rows = array();
- $destination = drupal_get_destination();
- foreach ($result as $data) {
- $row = array();
- $row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
- 'attributes' => array('title' => $data->alias),
- ));
- $row['data']['source'] = l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array(
- 'alias' => TRUE,
- 'attributes' => array('title' => $data->source),
- ));
- if ($multilanguage) {
- $row['data']['language_name'] = language_name($data->langcode);
- }
-
- $operations = array();
- $operations['edit'] = array(
- 'title' => t('edit'),
- 'href' => "admin/config/search/path/edit/$data->pid",
- 'query' => $destination,
- );
- $operations['delete'] = array(
- 'title' => t('delete'),
- 'href' => "admin/config/search/path/delete/$data->pid",
- 'query' => $destination,
- );
- $row['data']['operations'] = array(
- 'data' => array(
- '#type' => 'operations',
- '#links' => $operations,
- ),
- );
-
- // If the system path maps to a different URL alias, highlight this table
- // row to let the user know of old aliases.
- if ($data->alias != drupal_container()->get('path.alias_manager')->getPathAlias($data->source, $data->langcode)) {
- $row['class'] = array('warning');
- }
-
- $rows[] = $row;
- }
-
- $build['path_table'] = array(
- '#theme' => 'table',
- '#header' => $header,
- '#rows' => $rows,
- '#empty' => t('No URL aliases available. Add URL alias.', array('@link' => url('admin/config/search/path/add'))),
- );
- $build['path_pager'] = array('#theme' => 'pager');
-
- return $build;
-}
-
-/**
* Page callback: Returns a form creating or editing a path alias.
*
* @param $path
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 03be41b..524f748 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -59,10 +59,7 @@ function path_menu() {
$items['admin/config/search/path'] = array(
'title' => 'URL aliases',
'description' => "Change your site's URL paths by aliasing them.",
- 'page callback' => 'path_admin_overview',
- 'access arguments' => array('administer url aliases'),
- 'weight' => -5,
- 'file' => 'path.admin.inc',
+ 'route_name' => 'path_overview',
);
$items['admin/config/search/path/list'] = array(
'title' => 'List',
diff --git a/core/modules/path/path.routing.yml b/core/modules/path/path.routing.yml
index dbc6883..19c2670 100644
--- a/core/modules/path/path.routing.yml
+++ b/core/modules/path/path.routing.yml
@@ -4,3 +4,10 @@ path_delete:
_form: '\Drupal\path\Form\DeleteForm'
requirements:
_permission: 'administer url aliases'
+
+path_overview:
+ pattern: '/admin/config/search/path'
+ defaults:
+ _content: '\Drupal\path\Controller\PathController::adminOverview'
+ requirements:
+ _permission: 'administer url aliases'