Commit f101830d authored by catch's avatar catch

Issue #1862024 by katbailey: Remove all references to hook_url_inbound_alter()...

Issue #1862024 by katbailey: Remove all references to hook_url_inbound_alter() as it is no longer invoked.
parent 707c3d2f
......@@ -27,11 +27,9 @@ public function onKernelRequestMaintenanceModeCheck(GetResponseEvent $event) {
// Check if the site is offline.
$status = _menu_site_is_offline() ? MENU_SITE_OFFLINE : MENU_SITE_ONLINE;
// Allow other modules to change the site status but not the path because
// that would not change the global variable. hook_url_inbound_alter() can
// be used to change the path. Code later will not use the $read_only_path
// variable.
$read_only_path = !empty($path) ? $path : $event->getRequest()->attributes->get('system_path');
// Allow other modules to change the site status but not the path. The path
// can be changed using a request listener.
$read_only_path = $event->getRequest()->attributes->get('system_path');
drupal_alter('menu_site_status', $status, $read_only_path);
// Only continue if the site is online.
......
......@@ -24,7 +24,7 @@ class UrlAlterFunctionalTest extends WebTestBase {
public static function getInfo() {
return array(
'name' => t('URL altering'),
'description' => t('Tests hook_url_inbound_alter() and hook_url_outbound_alter().'),
'description' => t('Tests altering the inbound path and the outbound path.'),
'group' => t('Path API'),
);
}
......
......@@ -3328,38 +3328,13 @@ function hook_system_themes_page_alter(&$theme_groups) {
}
}
/**
* Alters inbound URL requests.
*
* @param $path
* The path being constructed, which, if a path alias, has been resolved to a
* Drupal path by the database, and which also may have been altered by other
* modules before this one.
* @param $original_path
* The original path, before being checked for path aliases or altered by any
* modules.
* @param $path_language
* The language of the path.
*
* @see \Drupal\Core\Path\AliasManager::getSystemPath()
*/
function hook_url_inbound_alter(&$path, $original_path, $path_language) {
// Create the path user/me/edit, which allows a user to edit their account.
if (preg_match('|^user/me/edit(/.*)?|', $path, $matches)) {
global $user;
$path = 'user/' . $user->uid . '/edit' . $matches[1];
}
}
/**
* Alters outbound URLs.
*
* @param $path
* The outbound path to alter, not adjusted for path aliases yet. It won't be
* adjusted for path aliases until all modules are finished altering it, thus
* being consistent with hook_url_inbound_alter(), which adjusts for all path
* aliases before allowing modules to alter it. This may have been altered by
* other modules before this one.
* adjusted for path aliases until all modules are finished altering it. This
* may have been altered by other modules before this one.
* @param $options
* A set of URL options for the URL so elements such as a fragment or a query
* string can be added to the URL.
......@@ -3739,7 +3714,7 @@ function hook_countries_alter(&$countries) {
* for delivery directly.
* @param $path
* Contains the system path that is going to be loaded. This is read only,
* use hook_url_inbound_alter() to change the path.
* use a request listener to change the inbound path.
*/
function hook_menu_site_status_alter(&$menu_site_status, $path) {
// Allow access to my_module/authentication even if site is in offline mode.
......
name = Url_alter tests
description = A support modules for url_alter hook testing.
description = A support module to test altering the inbound and outbound path.
core = 8.x
package = Testing
version = VERSION
......
......@@ -2,7 +2,7 @@
/**
* @file
* Module to help test hook_url_inbound_alter() and hook_url_outbound_alter().
* Module to help test altering the inbound and outbound path.
*/
/**
......
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