Switch to using the new system path rathe than ['q'].

8.0.x
Larry Garfield 2012-04-06 16:06:30 -05:00
parent ef0a9e627d
commit df49a0704e
2 changed files with 2 additions and 2 deletions

View File

@ -3800,7 +3800,7 @@ function _menu_site_is_offline($check_only = FALSE) {
// Ensure that the maintenance mode message is displayed only once
// (allowing for page redirects) and specifically suppress its display on
// the maintenance mode settings page.
if (!$check_only && $_GET['q'] != 'admin/config/development/maintenance') {
if (!$check_only && request()->attributes->get('system_path') != '/admin/config/development/maintenance') {
if (user_access('administer site configuration')) {
drupal_set_message(t('Operating in maintenance mode. <a href="@url">Go online.</a>', array('@url' => url('admin/config/development/maintenance'))), 'status', FALSE);
}

View File

@ -31,7 +31,7 @@ class MaintenanceModeSubscriber implements EventSubscriberInterface {
// 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 : $_GET['q'];
$read_only_path = !empty($path) ? $path : $event->getRequest()->attributes->get('system_path');
drupal_alter('menu_site_status', $page_callback_result, $read_only_path);
// Only continue if the site is online.