diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d763045..c958c60 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -543,6 +543,9 @@ function install_run_task($task, &$install_state) { } // Process the batch. For progressive batches, this will redirect. // Otherwise, the batch will complete. + // install_redirect_url() returns core/install.php, so let's ensure to + // drop it from it and use base:// as batch_process() is using the + // unrouted url assembler, which requires base://. $response = batch_process(preg_replace('@^core/@', 'base://', install_redirect_url($install_state)), install_full_redirect_url($install_state)); if ($response instanceof Response) { // Save $_SESSION data from batch. diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 71ecd5e..6a51027 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -595,8 +595,8 @@ function template_preprocess_username(&$variables) { // We have a link path, so we should generate a URL. if (isset($variables['link_path'])) { if ($external) { - $variables['attributes']['href'] = \Drupal::service('unrouted_url_assembler') - ->assemble($variables['link_path'], $variables['link_options']); + $variables['attributes']['href'] = Url::unrouted($variables['link_path'], $variables['link_options']) + ->toString(); } else { $variables['attributes']['href'] = Url::routed('entity.user.canonical', array( diff --git a/core/modules/views_ui/src/Tests/RedirectTest.php b/core/modules/views_ui/src/Tests/RedirectTest.php index 519ec79..30d387c 100644 --- a/core/modules/views_ui/src/Tests/RedirectTest.php +++ b/core/modules/views_ui/src/Tests/RedirectTest.php @@ -27,17 +27,17 @@ class RedirectTest extends UITestBase { public function testRedirect() { $view_name = 'test_view'; - $random_destination = 'node'; + $random_destination = $this->randomMachineName(); $edit_path = "admin/structure/views/view/$view_name/edit"; - $this->drupalPostForm($edit_path, array(), t('Save') , array('query' => array('destination' => 'node'))); - $this->assertUrl('node', array(), 'Make sure the user got redirected to the expected page defined in the destination.'); + $this->drupalPostForm($edit_path, array(), t('Save') , array('query' => array('destination' => $random_destination))); + $this->assertUrl($random_destination, array(), 'Make sure the user got redirected to the expected page defined in the destination.'); // Setup a view with a certain page display path. If you change the path // but have the old url in the destination the user should be redirected to // the new path. $view_name = 'test_redirect_view'; - $new_path = 'user'; + $new_path = $this->randomMachineName(); $edit_path = "admin/structure/views/view/$view_name/edit"; $path_edit_path = "admin/structure/views/nojs/display/$view_name/page_1/path"; diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index a0f7ca6..ed87d4d 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -323,10 +323,9 @@ public function save(array $form, FormStateInterface $form_state) { $query->remove('destination'); } } - $form_state->setRedirectUrl(Url::createFromRequest(Request::create("/$destination"))); + $form_state->setRedirectUrl(Url::unrouted("base://$destination")); } - $view->save(); drupal_set_message($this->t('The view %name has been saved.', array('%name' => $view->label()))); // Remove this view from cache so we can edit it properly.