diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 47f85ed..7e6e12f 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -45,7 +45,7 @@ function _batch_page(Request $request) { $batch = \Drupal::service('batch.storage')->load($request_id); if (!$batch) { drupal_set_message(t('No active batch.'), 'error'); - return new RedirectResponse(url('', array('absolute' => TRUE))); + return new RedirectResponse(\Drupal::url('', [], ['absolute' => TRUE])); } } // Restore safe strings from previous batches. diff --git a/core/includes/common.inc b/core/includes/common.inc index 3b6f1dd..04d17a4 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -678,7 +678,7 @@ function drupal_http_header_attributes(array $attributes = array()) { * However, for links enclosed in translatable text you should use t() and * embed the HTML anchor tag directly in the translated string. For example: * @code - * t('Visit the settings page', array('@url' => url('admin'))); + * t('Visit the settings page', array('@url' => \Drupal::url('system.admin'))); * @endcode * This keeps the context of the link title ('settings' in the example) for * translators. diff --git a/core/includes/install.inc b/core/includes/install.inc index 67e24a7..8c2e9fe 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -647,8 +647,9 @@ function drupal_install_system($install_state) { // Install base system configuration. \Drupal::service('config.installer')->installDefaultConfig('core', 'core'); - // Install System module. + // Install System module and rebuild the newly available routes. $kernel->getContainer()->get('module_handler')->install(array('system'), FALSE); + \Drupal::service('router.builder')->rebuild(); // DrupalKernel::prepareLegacyRequest() above calls into // DrupalKernel::bootCode(), which primes file_get_stream_wrappers()'s static diff --git a/core/lib/Drupal/Core/Routing/NullGenerator.php b/core/lib/Drupal/Core/Routing/NullGenerator.php index 93714e4..25a99bf 100644 --- a/core/lib/Drupal/Core/Routing/NullGenerator.php +++ b/core/lib/Drupal/Core/Routing/NullGenerator.php @@ -25,6 +25,7 @@ class NullGenerator extends UrlGenerator { */ public function __construct(RequestStack $request_stack) { $this->requestStack = $request_stack; + $this->context = new RequestContext(); } /** @@ -34,10 +35,26 @@ public function __construct(RequestStack $request_stack) { * protected method. */ protected function getRoute($name) { + if ($name === '') { + return new Route('/'); + } throw new RouteNotFoundException(); } /** + * {@inheritdoc} + */ + protected function processRoute(Route $route, array &$parameters) { + } + + /** + * {@inheritdoc} + */ + protected function getInternalPathFromRoute(Route $route, $parameters = array()) { + return $route->getPath(); + } + + /** * Overrides Drupal\Core\Routing\UrlGenerator::setContext(); */ public function setContext(RequestContext $context) { diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 73c1bcb..bd63149 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -563,7 +563,7 @@ function template_preprocess_forums(&$variables) { ->getNewCommentPageNumber($topic->comment_count, $topic->new_replies, $topic, 'comment_forum'); $query = $page_number ? array('page' => $page_number) : NULL; $variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new post in topic %title', '@count new posts in topic %title', array('%title' => $variables['topics'][$id]->label())); - $variables['topics'][$id]->new_url = url('node/' . $topic->id(), array('query' => $query, 'fragment' => 'new')); + $variables['topics'][$id]->new_url = \Drupal::url('entity.node.canonical', ['node' => $topic->id()], ['query' => $query, 'fragment' => 'new']); } // Build table rows from topics. @@ -645,7 +645,7 @@ function template_preprocess_forum_list(&$variables) { $variables['forums'][$id]->new_topics = \Drupal::service('forum_manager')->unreadTopics($forum->id(), $user->id()); if ($variables['forums'][$id]->new_topics) { $variables['forums'][$id]->new_text = format_plural($variables['forums'][$id]->new_topics, '1 new post in forum %title', '@count new posts in forum %title', array('%title' => $variables['forums'][$id]->label())); - $variables['forums'][$id]->new_url = url('forum/' . $forum->id(), array('fragment' => 'new')); + $variables['forums'][$id]->new_url = \Drupal::url('forum.page', ['taxonomy_term' => $forum->id()], ['fragment' => 'new']); $variables['forums'][$id]->icon_class = 'new'; $variables['forums'][$id]->icon_title = t('New posts'); } diff --git a/core/modules/menu_ui/src/MenuSettingsForm.php b/core/modules/menu_ui/src/MenuSettingsForm.php index 9037bb5..ed89381 100644 --- a/core/modules/menu_ui/src/MenuSettingsForm.php +++ b/core/modules/menu_ui/src/MenuSettingsForm.php @@ -29,7 +29,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('menu_ui.settings'); $form['intro'] = array( '#type' => 'item', - '#markup' => t('The Menu UI module allows on-the-fly creation of menu links in the content authoring forms. To configure these settings for a particular content type, visit the Content types page, click the edit link for the content type, and go to the Menu settings section.', array('@content-types' => url('admin/structure/types'))), + '#markup' => t('The Menu UI module allows on-the-fly creation of menu links in the content authoring forms. To configure these settings for a particular content type, visit the Content types page, click the edit link for the content type, and go to the Menu settings section.', array('@content-types' => \Drupal::url('node.overview_types'))), ); $menu_options = menu_ui_get_menus(); diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc index e5097bf..075c448 100644 --- a/core/modules/node/node.tokens.inc +++ b/core/modules/node/node.tokens.inc @@ -165,11 +165,11 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr break; case 'url': - $replacements[$original] = url('node/' . $node->id(), $url_options); + $replacements[$original] = \Drupal::url('entity.node.canonical', ['node' => $node->id()], $url_options); break; case 'edit-url': - $replacements[$original] = url('node/' . $node->id() . '/edit', $url_options); + $replacements[$original] = \Drupal::url('entity.node.edit_form', ['node' => $node->id()], $url_options); break; // Default values for the chained tokens handled below. diff --git a/core/modules/node/src/Form/DeleteMultiple.php b/core/modules/node/src/Form/DeleteMultiple.php index 3257e2b..7b2aced 100644 --- a/core/modules/node/src/Form/DeleteMultiple.php +++ b/core/modules/node/src/Form/DeleteMultiple.php @@ -99,7 +99,7 @@ public function getConfirmText() { public function buildForm(array $form, FormStateInterface $form_state) { $this->nodes = $this->tempStoreFactory->get('node_multiple_delete_confirm')->get(\Drupal::currentUser()->id()); if (empty($this->nodes)) { - return new RedirectResponse(url('admin/content', array('absolute' => TRUE))); + return new RedirectResponse($this->getCancelUrl()->setAbsolute()->toString()); } $form['nodes'] = array( diff --git a/core/modules/system/src/Form/CronForm.php b/core/modules/system/src/Form/CronForm.php index 595d830..07973f1 100644 --- a/core/modules/system/src/Form/CronForm.php +++ b/core/modules/system/src/Form/CronForm.php @@ -113,7 +113,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['cron']['cron_safe_threshold'] = array( '#type' => 'select', '#title' => t('Run cron every'), - '#description' => t('More information about setting up scheduled tasks can be found by reading the cron tutorial on drupal.org.', array('@url' => url('http://drupal.org/cron'))), + '#description' => t('More information about setting up scheduled tasks can be found by reading the cron tutorial on drupal.org.', array('@url' => 'http://drupal.org/cron')), '#default_value' => $config->get('threshold.autorun'), '#options' => array(0 => t('Never')) + array_map(array($this->dateFormatter, 'formatInterval'), array_combine($options, $options)), ); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 541ba9f..041e04f 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -407,7 +407,7 @@ function system_requirements($phase) { } // The files directory requirement check is done only during install and runtime. if ($phase == 'runtime') { - $description = $error . t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/config/media/file-system'))); + $description = $error . t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => \Drupal::url('system.file_system_settings'))); } elseif ($phase == 'install') { // For the installer UI, we need different wording. 'value' will @@ -534,7 +534,10 @@ function system_requirements($phase) { $requirements['update status'] = array( 'value' => t('Not enabled'), 'severity' => REQUIREMENT_WARNING, - 'description' => t('Update notifications are not enabled. It is highly recommended that you enable the Update Manager module from the module administration page in order to stay up-to-date on new releases. For more information, Update status handbook page.', array('@update' => 'http://drupal.org/documentation/modules/update', '@module' => url('admin/modules'))), + 'description' => t('Update notifications are not enabled. It is highly recommended that you enable the Update Manager module from the module administration page in order to stay up-to-date on new releases. For more information, Update status handbook page.', array( + '@update' => 'http://drupal.org/documentation/modules/update', + '@module' => \Drupal::url('system.modules_list'), + )), ); } else { diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/EntityReferenceTaxonomyTermRssFormatter.php b/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/EntityReferenceTaxonomyTermRssFormatter.php index 90a0c92..5be584c 100644 --- a/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/EntityReferenceTaxonomyTermRssFormatter.php +++ b/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/EntityReferenceTaxonomyTermRssFormatter.php @@ -37,7 +37,7 @@ public function viewElements(FieldItemListInterface $items) { 'key' => 'category', 'value' => $item->entity->label(), 'attributes' => array( - 'domain' => $item->target_id ? \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy/term' => $item->target_id], array('absolute' => TRUE)) : '', + 'domain' => $item->target_id ? \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $item->target_id], array('absolute' => TRUE)) : '', ), ); } diff --git a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php index 1ce633f..0e061da 100644 --- a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php +++ b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php @@ -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]'] = \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term2->id()], 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]'] = \Drupal::url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term1->id()], 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/update/src/Form/UpdateReady.php b/core/modules/update/src/Form/UpdateReady.php index 66e94de..7f4c5da 100644 --- a/core/modules/update/src/Form/UpdateReady.php +++ b/core/modules/update/src/Form/UpdateReady.php @@ -75,7 +75,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['backup'] = array( '#prefix' => '', - '#markup' => $this->t('Back up your database and site before you continue. Learn how.', array('@backup_url' => url('http://drupal.org/node/22281'))), + '#markup' => $this->t('Back up your database and site before you continue. Learn how.', array('@backup_url' => 'http://drupal.org/node/22281')), '#suffix' => '', ); diff --git a/core/modules/update/src/UpdateSettingsForm.php b/core/modules/update/src/UpdateSettingsForm.php index fb872b6..81ef7e0 100644 --- a/core/modules/update/src/UpdateSettingsForm.php +++ b/core/modules/update/src/UpdateSettingsForm.php @@ -62,7 +62,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'all' => t('All newer versions'), 'security' => t('Only security updates'), ), - '#description' => t('You can choose to send email only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the status report page, and will also display an error message on administration pages if there is a security update.', array('@status_report' => url('admin/reports/status'))) + '#description' => t('You can choose to send email only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the status report page, and will also display an error message on administration pages if there is a security update.', array('@status_report' => $this->url('system.status'))) ); return parent::buildForm($form, $form_state); diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index 1faf7fd..41866c7 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -58,7 +58,7 @@ function update_manager_download_batch_finished($success, $results) { elseif ($success) { drupal_set_message(t('Updates downloaded successfully.')); $_SESSION['update_manager_update_projects'] = $results['projects']; - return new RedirectResponse(url('admin/update/ready', array('absolute' => TRUE))); + return new RedirectResponse(\Drupal::url('update.confirmation_page', [], ['absolute' => TRUE])); } else { // Ideally we're catching all Exceptions, so they should never see this, diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 4201e5d..65e1364 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -72,7 +72,10 @@ function update_help($route_name, RouteMatchInterface $route_match) { case 'help.page.update': $output = ''; $output .= '

' . t('About') . '

'; - $output .= '

' . t("The Update Manager module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts administrators to available updates. In order to provide update information, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the Module administration page. For more information, see the online handbook entry for Update Manager module.", array('@update' => 'http://drupal.org/documentation/modules/update', '@modules' => url('admin/modules'))) . '

'; + $output .= '

' . t("The Update Manager module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts administrators to available updates. In order to provide update information, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the Module administration page. For more information, see the online handbook entry for Update Manager module.", [ + '@update' => 'http://drupal.org/documentation/modules/update', + '@modules' => \Drupal::url('system.modules_list'), + ]) . '

'; // Only explain the Update manager if it has not been disabled. if (update_manager_access()) { $output .= '

' . t('The Update manager also allows administrators to update and install modules and themes through the administration interface.') . '

'; @@ -80,13 +83,26 @@ function update_help($route_name, RouteMatchInterface $route_match) { $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Checking for available updates') . '
'; - $output .= '
' . t('A report of available updates will alert you when new releases are available for download. You may configure options for the frequency for checking updates (which are performed during cron runs) and email notifications at the Update Manager settings page.', array('@update-report' => url('admin/reports/updates'), '@cron' => 'http://drupal.org/cron', '@update-settings' => url('admin/reports/updates/settings'))) . '
'; + $output .= '
' . t('A report of available updates will alert you when new releases are available for download. You may configure options for the frequency for checking updates (which are performed during cron runs) and email notifications at the Update Manager settings page.', [ + '@update-report' => \Drupal::url('update.status'), + '@cron' => 'http://drupal.org/cron', + '@update-settings' => \Drupal::url('update.settings'), + ]) . '
'; // Only explain the Update manager if it has not been disabled. if (update_manager_access()) { $output .= '
' . t('Performing updates through the user interface') . '
'; - $output .= '
' . t('The Update Manager module allows administrators to perform updates directly through the administration interface. At the top of the modules and themes pages you will see a link to update to new releases. This will direct you to the update page where you see a listing of all the missing updates and confirm which ones you want to upgrade. From there, you are prompted for your FTP/SSH password, which then transfers the files into your Drupal installation, overwriting your old files. More detailed instructions can be found in the online handbook.', array('@modules_page' => url('admin/modules'), '@themes_page' => url('admin/appearance'), '@update-page' => url('admin/reports/updates/update'), '@update' => 'http://drupal.org/documentation/modules/update')) . '
'; + $output .= '
' . t('The Update Manager module allows administrators to perform updates directly through the administration interface. At the top of the modules and themes pages you will see a link to update to new releases. This will direct you to the update page where you see a listing of all the missing updates and confirm which ones you want to upgrade. From there, you are prompted for your FTP/SSH password, which then transfers the files into your Drupal installation, overwriting your old files. More detailed instructions can be found in the online handbook.', [ + '@modules_page' => \Drupal::url('system.modules_list'), + '@themes_page' => \Drupal::url('system.themes_page'), + '@update-page' => \Drupal::url('update.report_update'), + '@update' => 'http://drupal.org/documentation/modules/update', + ]) . '
'; $output .= '
' . t('Installing new modules and themes through the user interface') . '
'; - $output .= '
' . t('You can also install new modules and themes in the same fashion, through the install page, or by clicking the Install new module/theme link at the top of the modules and themes pages. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', array('@modules_page' => url('admin/modules'), '@themes_page' => url('admin/appearance'), '@install' => url('admin/reports/updates/install'))) . '
'; + $output .= '
' . t('You can also install new modules and themes in the same fashion, through the install page, or by clicking the Install new module/theme link at the top of the modules and themes pages. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', [ + '@modules_page' => \Drupal::url('system.modules_list'), + '@themes_page' => \Drupal::url('system.themes_page'), + '@install' => \Drupal::url('update.report_install'), + ]) . '
'; } $output .= '
'; return $output; @@ -278,8 +294,8 @@ function update_storage_clear_submit($form, FormStateInterface $form_state) { function _update_no_data() { $destination = drupal_get_destination(); return t('No update information available. Run cron or check manually.', array( - '@run_cron' => url('admin/reports/status/run-cron', array('query' => $destination)), - '@check_manually' => url('admin/reports/updates/check', array('query' => $destination)), + '@run_cron' => \Drupal::url('system.run_cron', [], ['query' => $destination]), + '@check_manually' => \Drupal::url('update.manual_status', [], ['query' => $destination]), )); } @@ -440,11 +456,11 @@ function update_mail($key, &$message, $params) { foreach ($params as $msg_type => $msg_reason) { $message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $langcode); } - $message['body'][] = t('See the available updates page for more information:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates', array('absolute' => TRUE, 'language' => $language)); + $message['body'][] = t('See the available updates page for more information:', array(), array('langcode' => $langcode)) . "\n" . \Drupal::url('update.status', [], ['absolute' => TRUE, 'language' => $language]); if (update_manager_access()) { - $message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates/update', array('absolute' => TRUE, 'language' => $language)); + $message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . \Drupal::url('update.report_update', [], ['absolute' => TRUE, 'language' => $language]); } - $settings_url = url('admin/reports/updates/settings', array('absolute' => TRUE)); + $settings_url = \Drupal::url('update.settings', [], ['absolute' => TRUE]); if (\Drupal::config('update.settings')->get('notification.threshold') == 'all') { $message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, !url.', array('!url' => $settings_url)); } @@ -518,10 +534,10 @@ function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $lan case UPDATE_NOT_FETCHED: case UPDATE_FETCH_PENDING: if ($msg_type == 'core') { - $text = t('There was a problem checking available updates for Drupal.', array('@update-report' => url('admin/reports/updates')), array('langcode' => $langcode)); + $text = t('There was a problem checking available updates for Drupal.', array('@update-report' => \Drupal::url('update.status')), array('langcode' => $langcode)); } else { - $text = t('There was a problem checking available updates for your modules or themes.', array('@update-report' => url('admin/reports/updates')), array('langcode' => $langcode)); + $text = t('There was a problem checking available updates for your modules or themes.', array('@update-report' => \Drupal::url('update.status')), array('langcode' => $langcode)); } break; } @@ -533,10 +549,10 @@ function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $lan } if ($report_link) { if (update_manager_access()) { - $text .= ' ' . t('See the available updates page for more information and to install your missing updates.', array('@available_updates' => url('admin/reports/updates/update', array('language' => $language))), array('langcode' => $langcode)); + $text .= ' ' . t('See the available updates page for more information and to install your missing updates.', array('@available_updates' => \Drupal::url('update.report_update', [], ['language' => $language])), array('langcode' => $langcode)); } else { - $text .= ' ' . t('See the available updates page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), array('langcode' => $langcode)); + $text .= ' ' . t('See the available updates page for more information.', array('@available_updates' => \Drupal::url('update.status', [], ['language' => $language])), array('langcode' => $langcode)); } } diff --git a/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php b/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php index f6aee69..745c0cb 100644 --- a/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php +++ b/core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php @@ -62,25 +62,25 @@ public function onKernelRequestMaintenance(GetResponseEvent $event) { if ($this->account->isAuthenticated() && !$this->maintenanceMode->exempt($this->account)) { user_logout(); // Redirect to homepage. - $event->setResponse(new RedirectResponse(url('', array('absolute' => TRUE)))); + $event->setResponse(new RedirectResponse(\Drupal::url('', [], ['absolute' => TRUE]))); return; } if ($this->account->isAnonymous() && $path == 'user') { // Forward anonymous user to login page. - $event->setResponse(new RedirectResponse(url('user/login', array('absolute' => TRUE)))); + $event->setResponse(new RedirectResponse(\Drupal::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(url('user', array('absolute' => TRUE)))); + $event->setResponse(new RedirectResponse(\Drupal::url('user.page', [], ['absolute' => TRUE]))); return; } if ($path == 'user/register') { // Authenticated user should be redirected to user edit page. - $event->setResponse(new RedirectResponse(url('user/' . $this->account->id() . '/edit', array('absolute' => TRUE)))); + $event->setResponse(new RedirectResponse(\Drupal::url('entity.user.edit_form', ['user' => $this->account->id()], ['absolute' => TRUE]))); return; } } diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php index ee222c0..b9dc99d 100644 --- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php +++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php @@ -157,7 +157,7 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) { elseif (!$form_state->get('ajax')) { // if nothing on the stack, non-js forms just go back to the main view editor. $display_id = $form_state->get('display_id'); - return new RedirectResponse(url("admin/structure/views/view/{$view->id()}/edit/$display_id", array('absolute' => TRUE))); + return new RedirectResponse($this->url('entity.view.edit_display_form', ['view' => $view->id(), 'display_id' => $display_id], ['absolute' => TRUE])); } else { $response = new AjaxResponse();