diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php index ca1d88b..6bc3a2c 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php @@ -31,7 +31,7 @@ function testShortcutLinkAdd() { 'source' => 'node/' . $this->node->nid, 'alias' => $this->randomName(8), ); - drupal_container()->get('path.crud')->save($path['source'], $path['alias']); + $this->container->get('path.crud')->save($path['source'], $path['alias']); // Create some paths to test. $test_cases = array( @@ -54,7 +54,7 @@ function testShortcutLinkAdd() { $saved_set = shortcut_set_load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'link_path'); $test_path = empty($test['path']) ? '' : $test['path']; - $this->assertTrue(in_array(drupal_container()->get('path.alias_manager')->getSystemPath($test_path), $paths), 'Shortcut created: '. $test['path']); + $this->assertTrue(in_array($this->container->get('path.alias_manager')->getSystemPath($test_path), $paths), 'Shortcut created: '. $test['path']); $this->assertLink($title, 0, 'Shortcut link found on the page.'); } } diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc index e8ab3b5..8b120fc 100644 --- a/core/modules/shortcut/shortcut.admin.inc +++ b/core/modules/shortcut/shortcut.admin.inc @@ -372,7 +372,7 @@ function _shortcut_link_form_elements($shortcut_link = NULL) { )); } else { - $shortcut_link['link_path'] = ($shortcut_link['link_path'] == '') ? '' : drupal_container()->get('path.alias_manager')->getPathAlias($shortcut_link['link_path']); + $shortcut_link['link_path'] = ($shortcut_link['link_path'] == '') ? '' : Drupal::service('path.alias_manager')->getPathAlias($shortcut_link['link_path']); } $form['shortcut_link']['#tree'] = TRUE; @@ -419,7 +419,7 @@ function shortcut_link_edit_validate($form, &$form_state) { */ function shortcut_link_edit_submit($form, &$form_state) { // Normalize the path in case it is an alias. - $shortcut_path = drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['shortcut_link']['link_path']); + $shortcut_path = Drupal::service('path.alias_manager')->getSystemPath($form_state['values']['shortcut_link']['link_path']); if (empty($shortcut_path)) { $shortcut_path = ''; } @@ -463,7 +463,7 @@ function shortcut_link_add_submit($form, &$form_state) { */ function shortcut_admin_add_link($shortcut_link, &$shortcut_set) { // Normalize the path in case it is an alias. - $shortcut_link['link_path'] = drupal_container()->get('path.alias_manager')->getSystemPath($shortcut_link['link_path']); + $shortcut_link['link_path'] = Drupal::service('path.alias_manager')->getSystemPath($shortcut_link['link_path']); if (empty($shortcut_link['link_path'])) { $shortcut_link['link_path'] = ''; } diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 8de14a0..c62977b 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -443,7 +443,7 @@ function shortcut_set_title_exists($title) { */ function shortcut_valid_link($path) { // Do not use URL aliases. - $normal_path = drupal_container()->get('path.alias_manager')->getSystemPath($path); + $normal_path = Drupal::service('path.alias_manager')->getSystemPath($path); if ($path != $normal_path) { $path = $normal_path; }