diff -u b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php --- b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php +++ b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Render\Element; +use Drupal\Core\Url as BaseUrl; use Drupal\Component\Utility\NestedArray; /** @@ -59,7 +60,7 @@ if (system_admin_compact_mode()) { $element['#title'] = \Drupal::translation()->translate('Show descriptions'); - $element['#url'] = \Drupal::url('system.admin_compact_page', array('mode' => 'off')); + $element['#url'] = BaseUrl::fromRoute('system.admin_compact_page', array('mode' => 'off')); $element['#options'] = array( 'attributes' => array('title' => \Drupal::translation()->translate('Expand layout to include descriptions.')), 'query' => drupal_get_destination(), @@ -67,7 +68,7 @@ } else { $element['#title'] = \Drupal::translation()->translate('Hide descriptions'); - $element['#url'] = \Drupal::url('system.admin_compact_page', array('mode' => 'on')); + $element['#url'] = BaseUrl::fromRoute('system.admin_compact_page', array('mode' => 'on')); $element['#options'] = array( 'attributes' => array('title' => \Drupal::translation()->translate('Compress layout by hiding descriptions.')), 'query' => drupal_get_destination(),