summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-12-10 13:51:05 (GMT)
committercatch2012-12-10 13:51:05 (GMT)
commitf101830de61c1d33980df0fd29b64806e1f499b3 (patch)
tree2e83b3ca85a5a4795ce01a5c85a31d0c040457cd
parent707c3d2f320fb3ff3b8ac6b2126e75911beab9ea (diff)
Issue #1862024 by katbailey: Remove all references to hook_url_inbound_alter() as it is no longer invoked.
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php8
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php2
-rw-r--r--core/modules/system/system.api.php31
-rw-r--r--core/modules/system/tests/modules/url_alter_test/url_alter_test.info2
-rw-r--r--core/modules/system/tests/modules/url_alter_test/url_alter_test.module2
5 files changed, 9 insertions, 36 deletions
diff --git a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
index d4eabfb..885db53 100644
--- a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
@@ -27,11 +27,9 @@ class MaintenanceModeSubscriber implements EventSubscriberInterface {
// 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.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
index 353ba18..b987739 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
@@ -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'),
);
}
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 926fd2c..eb4de0d 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -3329,37 +3329,12 @@ 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.
diff --git a/core/modules/system/tests/modules/url_alter_test/url_alter_test.info b/core/modules/system/tests/modules/url_alter_test/url_alter_test.info
index 1947b2e..7c8b67a 100644
--- a/core/modules/system/tests/modules/url_alter_test/url_alter_test.info
+++ b/core/modules/system/tests/modules/url_alter_test/url_alter_test.info
@@ -1,5 +1,5 @@
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
diff --git a/core/modules/system/tests/modules/url_alter_test/url_alter_test.module b/core/modules/system/tests/modules/url_alter_test/url_alter_test.module
index 61cc625..8bacb9b 100644
--- a/core/modules/system/tests/modules/url_alter_test/url_alter_test.module
+++ b/core/modules/system/tests/modules/url_alter_test/url_alter_test.module
@@ -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.
*/
/**