diff --git a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php index 5fc2e2b..96f9227 100644 --- a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php +++ b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php @@ -62,7 +62,7 @@ public function testBlockLinks() { $this->assertTrue(in_array('aggregator_feed:' . $feed->id(), $cache_tags)); // Visit that page. - $this->drupalGet($href); + $this->drupalGet($feed->urlInfo()->getInternalPath()); $correct_titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => $feed->label())); $this->assertFalse(empty($correct_titles), 'Aggregator feed page is available and has the correct title.'); $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index e7fe595..32ed795 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -95,7 +95,7 @@ public function form(array $form, FormStateInterface $form_state) { // If not replying to a comment, use our dedicated page callback for new // Comments on entities. if (!$comment->id() && !$comment->hasParentComment()) { - $form['#action'] = \Drupal::url('comment.reply', array('entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name)); + $form['#action'] = $this->url('comment.reply', array('entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name)); } $comment_preview = $form_state->get('comment_preview'); diff --git a/core/modules/config/tests/config_test/src/ConfigTestController.php b/core/modules/config/tests/config_test/src/ConfigTestController.php index 5e8e8fd..cb62642 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestController.php +++ b/core/modules/config/tests/config_test/src/ConfigTestController.php @@ -41,7 +41,7 @@ public function editTitle(ConfigTest $config_test) { */ function enable(ConfigTest $config_test) { $config_test->enable()->save(); - return new RedirectResponse(\Drupal::url('config_test.list_page', array(), array('absolute' => TRUE))); + return new RedirectResponse($this->url('config_test.list_page', array(), array('absolute' => TRUE))); } /** diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index db2ec60..cdba537 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -127,7 +127,7 @@ function contact_mail($key, &$message, $params) { case 'user_copy': $variables += array( '!recipient-name' => user_format_name($params['recipient']), - '!recipient-edit-url' => \Drupal::url('entity.user.edit_form', ['user' => $params['recipient']->id()], array('absolute' => TRUE, 'language' => $language)), + '!recipient-edit-url' => $params['recipient']->url('edit-form', array('absolute' => TRUE, 'language' => $language)), ); $message['subject'] .= t('[!site-name] !subject', $variables, $options); $message['body'][] = t('Hello !recipient-name,', $variables, $options); diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php index 72c40c9..8561acb 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -95,7 +95,7 @@ public function save(array $form, FormStateInterface $form_state) { if ($this->moduleHandler->moduleExists('block')) { // Tell the user they have the option to add a language switcher block // to their theme so they can switch between the languages. - drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the block administration page.', array('@block-admin' => \Drupal::url('block.admin_display')))); + drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the block administration page.', array('@block-admin' => $this->url('block.admin_display')))); } $form_state->setRedirect('language.admin_overview'); } diff --git a/core/modules/locale/src/Form/LocaleSettingsForm.php b/core/modules/locale/src/Form/LocaleSettingsForm.php index 1ff65a5..16c2087 100644 --- a/core/modules/locale/src/Form/LocaleSettingsForm.php +++ b/core/modules/locale/src/Form/LocaleSettingsForm.php @@ -36,14 +36,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { '7' => t('Weekly'), '30' => t('Monthly'), ), - '#description' => t('Select how frequently you want to check for new interface translations for your currently installed modules and themes. Check updates now.', array('@url' => \Drupal::url('locale.check_translation'))), + '#description' => t('Select how frequently you want to check for new interface translations for your currently installed modules and themes. Check updates now.', array('@url' => $this->url('locale.check_translation'))), ); if ($directory = $config->get('translation.path')) { - $description = t('Translation files are stored locally in the %path directory. You can change this directory on the File system configuration page.', array('%path' => $directory, '@url' => \Drupal::url('system.file_system_settings'))); + $description = t('Translation files are stored locally in the %path directory. You can change this directory on the File system configuration page.', array('%path' => $directory, '@url' => $this->url('system.file_system_settings'))); } else { - $description = t('Translation files will not be stored locally. Change the Interface translation directory on the File system configuration page.', array('@url' => \Drupal::url('system.file_system_settings'))); + $description = t('Translation files will not be stored locally. Change the Interface translation directory on the File system configuration page.', array('@url' => $this->url('system.file_system_settings'))); } $form['#translation_directory'] = $directory; $form['use_source'] = array( @@ -88,7 +88,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) { parent::validateForm($form, $form_state); if (empty($form['#translation_directory']) && $form_state->getValue('use_source') == LOCALE_TRANSLATION_USE_SOURCE_LOCAL) { - $form_state->setErrorByName('use_source', $this->t('You have selected local translation source, but no Interface translation directory was configured.', array('@url' => \Drupal::url('system.file_system_settings')))); + $form_state->setErrorByName('use_source', $this->t('You have selected local translation source, but no Interface translation directory was configured.', array('@url' => $this->url('system.file_system_settings')))); } } diff --git a/core/modules/simpletest/src/Form/SimpletestResultsForm.php b/core/modules/simpletest/src/Form/SimpletestResultsForm.php index afc54e6..56d4f59 100644 --- a/core/modules/simpletest/src/Form/SimpletestResultsForm.php +++ b/core/modules/simpletest/src/Form/SimpletestResultsForm.php @@ -113,7 +113,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $test_id if (is_numeric($test_id) && !$results = $this->getResults($test_id)) { drupal_set_message($this->t('No test results to display.'), 'error'); - return new RedirectResponse(\Drupal::url('simpletest.test_form', array(), array('absolute' => TRUE))); + return new RedirectResponse($this->url('simpletest.test_form', array(), array('absolute' => TRUE))); } // Load all classes and include CSS. diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php index 1e90774..43ab34e 100644 --- a/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -116,7 +116,7 @@ public static function create(ContainerInterface $container) { public function overview($link_id) { // Check for status report errors. if ($this->systemManager->checkRequirements() && $this->currentUser()->hasPermission('administer site configuration')) { - drupal_set_message($this->t('One or more problems were detected with your Drupal installation. Check the status report for more information.', array('@status' => \Drupal::url('system.status'))), 'error'); + drupal_set_message($this->t('One or more problems were detected with your Drupal installation. Check the status report for more information.', array('@status' => $this->url('system.status'))), 'error'); } // Load all menu links below it. $parameters = new MenuTreeParameters(); diff --git a/core/modules/system/src/Form/PerformanceForm.php b/core/modules/system/src/Form/PerformanceForm.php index 11d04bf..372b319 100644 --- a/core/modules/system/src/Form/PerformanceForm.php +++ b/core/modules/system/src/Form/PerformanceForm.php @@ -140,7 +140,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $disabled = !$is_writable; $disabled_message = ''; if (!$is_writable) { - $disabled_message = ' ' . t('Set up the public files directory to make these optimizations available.', array('!file-system' => \Drupal::url('system.file_system_settings'))); + $disabled_message = ' ' . t('Set up the public files directory to make these optimizations available.', array('!file-system' => $this->url('system.file_system_settings'))); } $form['bandwidth_optimization'] = array( diff --git a/core/modules/system/src/Form/SiteMaintenanceModeForm.php b/core/modules/system/src/Form/SiteMaintenanceModeForm.php index 24be993..b87533e 100644 --- a/core/modules/system/src/Form/SiteMaintenanceModeForm.php +++ b/core/modules/system/src/Form/SiteMaintenanceModeForm.php @@ -63,7 +63,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'checkbox', '#title' => t('Put site into maintenance mode'), '#default_value' => $this->state->get('system.maintenance_mode'), - '#description' => t('Visitors will only see the maintenance mode message. Only users with the "Access site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page.', array('@permissions-url' => \Drupal::url('user.admin_permissions'), '@user-login' => \Drupal::url('user.login'))), + '#description' => t('Visitors will only see the maintenance mode message. Only users with the "Access site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page.', array('@permissions-url' => $this->url('user.admin_permissions'), '@user-login' => $this->url('user.login'))), ); $form['maintenance_mode_message'] = array( '#type' => 'textarea', diff --git a/core/modules/taxonomy/src/Tests/RssTest.php b/core/modules/taxonomy/src/Tests/RssTest.php index 3d920e8..55b663d 100644 --- a/core/modules/taxonomy/src/Tests/RssTest.php +++ b/core/modules/taxonomy/src/Tests/RssTest.php @@ -98,7 +98,7 @@ function testTaxonomyRss() { 'key' => 'category', 'value' => $term1->getName(), 'attributes' => array( - 'domain' => \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term1->id()], array('absolute' => TRUE)), + 'domain' => $term1->url('canonical', array('absolute' => TRUE)), ), ); $this->assertRaw(format_xml_elements(array($test_element)), 'Term is displayed when viewing the rss feed.'); diff --git a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php index 0e061da..ab6a98c 100644 --- a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php +++ b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php @@ -85,7 +85,7 @@ function testTaxonomyTokenReplacement() { $tests['[term:tid]'] = $term1->id(); $tests['[term:name]'] = String::checkPlain($term1->getName()); $tests['[term:description]'] = $term1->description->processed; - $tests['[term:url]'] = \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term1->id()], array('absolute' => TRUE)); + $tests['[term:url]'] = $term1->url('canonical', array('absolute' => TRUE)); $tests['[term:node-count]'] = 0; $tests['[term:parent:name]'] = '[term:parent:name]'; $tests['[term:vocabulary:name]'] = String::checkPlain($this->vocabulary->name); @@ -100,10 +100,10 @@ function testTaxonomyTokenReplacement() { $tests['[term:tid]'] = $term2->id(); $tests['[term:name]'] = String::checkPlain($term2->getName()); $tests['[term:description]'] = $term2->description->processed; - $tests['[term:url]'] = \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term2->id()], array('absolute' => TRUE)); + $tests['[term:url]'] = $term2->url('canonical', array('absolute' => TRUE)); $tests['[term:node-count]'] = 1; $tests['[term:parent:name]'] = String::checkPlain($term1->getName()); - $tests['[term:parent:url]'] = \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term1->id()], array('absolute' => TRUE)); + $tests['[term:parent:url]'] = $term1->url('canonical', array('absolute' => TRUE)); $tests['[term:parent:parent:name]'] = '[term:parent:parent:name]'; $tests['[term:vocabulary:name]'] = String::checkPlain($this->vocabulary->name); diff --git a/core/modules/tour/src/Tests/TourTest.php b/core/modules/tour/src/Tests/TourTest.php index 5ab6691..8ed261c 100644 --- a/core/modules/tour/src/Tests/TourTest.php +++ b/core/modules/tour/src/Tests/TourTest.php @@ -58,7 +58,7 @@ public function testTourFunctionality() { $elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./p//a[@href=:href and contains(., :text)]]', array( ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1', ':data_id' => 'tour-test-1', - ':href' => \Drupal::url('', [], array('absolute' => TRUE)), + ':href' => \Drupal::url('', [], ['absolute' => TRUE]), ':text' => 'Drupal', )); $this->assertEqual(count($elements), 1, 'Found Token replacement.'); diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index 867f909..1b89bf5 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -361,7 +361,7 @@ public function validate(array $form, FormStateInterface $form_state) { $form_state->setErrorByName('mail', $this->t('The email address %email is already taken.', array('%email' => $mail))); } else { - $form_state->setErrorByName('mail', $this->t('The email address %email is already registered. Have you forgotten your password?', array('%email' => $mail, '@password' => \Drupal::url('user.pass')))); + $form_state->setErrorByName('mail', $this->t('The email address %email is already registered. Have you forgotten your password?', array('%email' => $mail, '@password' => $this->url('user.pass')))); } } } diff --git a/core/modules/user/src/AccountSettingsForm.php b/core/modules/user/src/AccountSettingsForm.php index a8f7fdf..28f9b7b 100644 --- a/core/modules/user/src/AccountSettingsForm.php +++ b/core/modules/user/src/AccountSettingsForm.php @@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'radios', '#title' => $this->t('When cancelling a user account'), '#default_value' => $config->get('cancel_method'), - '#description' => $this->t('Users with the %select-cancel-method or %administer-users permissions can override this default method.', array('%select-cancel-method' => $this->t('Select method for cancelling account'), '%administer-users' => $this->t('Administer users'), '@permissions-url' => \Drupal::url('user.admin_permissions'))), + '#description' => $this->t('Users with the %select-cancel-method or %administer-users permissions can override this default method.', array('%select-cancel-method' => $this->t('Select method for cancelling account'), '%administer-users' => $this->t('Administer users'), '@permissions-url' => $this->url('user.admin_permissions'))), ); $form['registration_cancellation']['user_cancel_method'] += user_cancel_methods(); foreach (Element::children($form['registration_cancellation']['user_cancel_method']) as $key) { diff --git a/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php b/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php index 745c0cb..ee5fb4f 100644 --- a/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php +++ b/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php @@ -8,6 +8,7 @@ namespace Drupal\user\EventSubscriber; use Drupal\Core\Routing\RouteMatch; +use Drupal\Core\Routing\UrlGeneratorTrait; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\MaintenanceModeInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -20,6 +21,8 @@ */ class MaintenanceModeSubscriber implements EventSubscriberInterface { + use UrlGeneratorTrait; + /** * The maintenance mode. * @@ -62,25 +65,25 @@ public function onKernelRequestMaintenance(GetResponseEvent $event) { if ($this->account->isAuthenticated() && !$this->maintenanceMode->exempt($this->account)) { user_logout(); // Redirect to homepage. - $event->setResponse(new RedirectResponse(\Drupal::url('', [], ['absolute' => TRUE]))); + $event->setResponse(new RedirectResponse($this->url('', [], ['absolute' => TRUE]))); return; } if ($this->account->isAnonymous() && $path == 'user') { // Forward anonymous user to login page. - $event->setResponse(new RedirectResponse(\Drupal::url('user.login', [], ['absolute' => TRUE]))); + $event->setResponse(new RedirectResponse($this->url('user.login', [], ['absolute' => TRUE]))); return; } } if ($this->account->isAuthenticated()) { if ($path == 'user/login') { // If user is logged in, redirect to 'user' instead of giving 403. - $event->setResponse(new RedirectResponse(\Drupal::url('user.page', [], ['absolute' => TRUE]))); + $event->setResponse(new RedirectResponse($this->url('user.page', [], ['absolute' => TRUE]))); return; } if ($path == 'user/register') { // Authenticated user should be redirected to user edit page. - $event->setResponse(new RedirectResponse(\Drupal::url('entity.user.edit_form', ['user' => $this->account->id()], ['absolute' => TRUE]))); + $event->setResponse(new RedirectResponse($this->url('entity.user.edit_form', ['user' => $this->account->id()], ['absolute' => TRUE]))); return; } } diff --git a/core/modules/user/src/Form/UserLoginForm.php b/core/modules/user/src/Form/UserLoginForm.php index a3c9d11..4cfdff3 100644 --- a/core/modules/user/src/Form/UserLoginForm.php +++ b/core/modules/user/src/Form/UserLoginForm.php @@ -207,15 +207,15 @@ public function validateFinal(array &$form, FormStateInterface $form_state) { if ($flood_control_triggered = $form_state->get('flood_control_triggered')) { if ($flood_control_triggered == 'user') { - $form_state->setErrorByName('name', format_plural($flood_config->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => \Drupal::url('user.pass')))); + $form_state->setErrorByName('name', format_plural($flood_config->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => $this->url('user.pass')))); } else { // We did not find a uid, so the limit is IP-based. - $form_state->setErrorByName('name', $this->t('Sorry, too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.', array('@url' => \Drupal::url('user.pass')))); + $form_state->setErrorByName('name', $this->t('Sorry, too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.', array('@url' => $this->url('user.pass')))); } } else { - $form_state->setErrorByName('name', $this->t('Sorry, unrecognized username or password. Have you forgotten your password?', array('@password' => \Drupal::url('user.pass', [], array('query' => array('name' => $form_state->getValue('name'))))))); + $form_state->setErrorByName('name', $this->t('Sorry, unrecognized username or password. Have you forgotten your password?', array('@password' => $this->url('user.pass', [], array('query' => array('name' => $form_state->getValue('name'))))))); $accounts = $this->userStorage->loadByProperties(array('name' => $form_state->getValue('name'))); if (!empty($accounts)) { $this->logger('user')->notice('Login attempt failed for %user.', array('%user' => $form_state->getValue('name'))); diff --git a/core/modules/user/src/Plugin/Search/UserSearch.php b/core/modules/user/src/Plugin/Search/UserSearch.php index fd51a74..33d4097 100644 --- a/core/modules/user/src/Plugin/Search/UserSearch.php +++ b/core/modules/user/src/Plugin/Search/UserSearch.php @@ -143,7 +143,7 @@ public function execute() { foreach ($accounts as $account) { $result = array( 'title' => $account->getUsername(), - 'link' => \Drupal::url('entity.user.canonical', ['user' => $account->id()], array('absolute' => TRUE)), + 'link' => $account->url('canonical', array('absolute' => TRUE)), ); if ($this->currentUser->hasPermission('administer users')) { $result['title'] .= ' (' . $account->getEmail() . ')'; diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php index fb59502..9ca0c95 100644 --- a/core/modules/user/src/RegisterForm.php +++ b/core/modules/user/src/RegisterForm.php @@ -43,7 +43,7 @@ public function form(array $form, FormStateInterface $form_state) { // If we aren't admin but already logged on, go to the user page instead. if (!$admin && $user->isAuthenticated()) { - return new RedirectResponse(\Drupal::url('entity.user.canonical', ['user' => \Drupal::currentUser()->id()], array('absolute' => TRUE))); + return new RedirectResponse($this->url('entity.user.canonical', ['user' => \Drupal::currentUser()->id()], array('absolute' => TRUE))); } $form['#attached']['library'][] = 'core/drupal.form'; diff --git a/core/modules/user/src/Tests/UserTokenReplaceTest.php b/core/modules/user/src/Tests/UserTokenReplaceTest.php index ea24998..3d9e8fe 100644 --- a/core/modules/user/src/Tests/UserTokenReplaceTest.php +++ b/core/modules/user/src/Tests/UserTokenReplaceTest.php @@ -57,8 +57,8 @@ function testUserTokenReplacement() { $tests['[user:uid]'] = $account->id(); $tests['[user:name]'] = String::checkPlain(user_format_name($account)); $tests['[user:mail]'] = String::checkPlain($account->getEmail()); - $tests['[user:url]'] = \Drupal::url('entity.user.canonical', ['user' => $account->id()], $url_options); - $tests['[user:edit-url]'] = \Drupal::url('entity.user.edit_form', ['user' => $account->id()], $url_options); + $tests['[user:url]'] = $account->url('canonical', $url_options); + $tests['[user:edit-url]'] = $account->url('edit-form', $url_options); $tests['[user:last-login]'] = format_date($account->getLastLoginTime(), 'medium', '', NULL, $language_interface->id); $tests['[user:last-login:short]'] = format_date($account->getLastLoginTime(), 'short', '', NULL, $language_interface->id); $tests['[user:created]'] = format_date($account->getCreatedTime(), 'medium', '', NULL, $language_interface->id); diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index 38fb651..928a56a 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -136,7 +136,7 @@ function hook_user_login($account) { $config = \Drupal::config('system.date'); // If the user has a NULL time zone, notify them to set a time zone. if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) { - drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => \Drupal::url('entity.user.edit_form', ['user' => $account->id()], array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone'))))); + drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => $account->url('edit-form', array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone'))))); } } diff --git a/core/modules/user/user.tokens.inc b/core/modules/user/user.tokens.inc index dcaed97..073b90f 100644 --- a/core/modules/user/user.tokens.inc +++ b/core/modules/user/user.tokens.inc @@ -98,11 +98,11 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr break; case 'url': - $replacements[$original] = $account->id() ? \Drupal::url('entity.user.canonical', ['user' => $account->id()], $url_options) : t('not yet assigned'); + $replacements[$original] = $account->id() ? $account->url('canonical', $url_options) : t('not yet assigned'); break; case 'edit-url': - $replacements[$original] = $account->id() ? \Drupal::url('entity.user.edit_form', ['user' => $account->id()], $url_options) : t('not yet assigned'); + $replacements[$original] = $account->id() ? $account->url('edit-form', $url_options) : t('not yet assigned'); break; // These tokens are default variations on the chained tokens handled below. diff --git a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php index 1c28718..c6e24db 100644 --- a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php +++ b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php @@ -39,7 +39,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Reorder displays'); $form['#section'] = 'reorder'; - $form['#action'] = \Drupal::url('views_ui.form_reorder_displays', [ + $form['#action'] = $this->url('views_ui.form_reorder_displays', [ 'js' => 'nojs', 'view' => $view->id(), 'display_id' => $display_id,