diff --git a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php index 5147407..b58078d 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php @@ -34,6 +34,8 @@ public static function buildCancelLink(ConfirmFormInterface $form, Request $requ // If a destination is specified, that serves as the cancel link. if ($query->has('destination')) { $options = UrlHelper::parse($query->get('destination')); + // @todo Use Url::fromPath() once https://www.drupal.org/node/2351379 is + // resolved. $url = Url::fromUri('base://' . $options['path'], $options); } // Check for a route-based cancel link. diff --git a/core/modules/field_ui/src/FieldUI.php b/core/modules/field_ui/src/FieldUI.php index 7edb1c6..1658c79 100644 --- a/core/modules/field_ui/src/FieldUI.php +++ b/core/modules/field_ui/src/FieldUI.php @@ -59,6 +59,8 @@ public static function getNextDestination(array $destinations) { $options['query']['destinations'] = $destinations; } // Redirect to any given path within the same domain. + // @todo Use Url::fromPath() once https://www.drupal.org/node/2351379 is + // resolved. $next_destination = Url::fromUri('base://' . $options['path']); } return $next_destination; diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php index f7c0d4a..925c84e 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php @@ -54,6 +54,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { public function submitForm(array &$form, FormStateInterface $form_state) { if (!$form_state->isValueEmpty('redirection')) { if (!$form_state->isValueEmpty('destination')) { + // @todo Use Url::fromPath() once https://www.drupal.org/node/2351379 is + // resolved. $form_state->setRedirectUrl(Url::fromUri('base://' . $form_state->getValue('destination'))); } } diff --git a/core/modules/views_ui/src/Tests/DisplayPathTest.php b/core/modules/views_ui/src/Tests/DisplayPathTest.php index 7e553e3..3f79d64 100644 --- a/core/modules/views_ui/src/Tests/DisplayPathTest.php +++ b/core/modules/views_ui/src/Tests/DisplayPathTest.php @@ -48,6 +48,10 @@ protected function doBasicPathUITest() { // Save a path and make sure the summary appears as expected. $random_path = $this->randomMachineName(); + // @todo Once https://www.drupal.org/node/2351379 is resolved, Views will no + // longer use Url::fromUri(), and this path will be able to contain ':'. + $random_path = str_replace(':', '', $random_path); + $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => $random_path), t('Apply')); $this->assertText('/' . $random_path, 'The custom path appears in the summary.'); $this->assertLink(t('View @display', array('@display' => 'Page')), 0, 'view page link found on the page.'); diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 90afe5d..ea3ba88 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -320,6 +320,8 @@ public function save(array $form, FormStateInterface $form_state) { $query->remove('destination'); } } + // @todo Use Url::fromPath() once https://www.drupal.org/node/2351379 is + // resolved. $form_state->setRedirectUrl(Url::fromUri("base://$destination")); } @@ -424,6 +426,8 @@ public function getDisplayDetails($view, $display) { '#type' => 'link', '#title' => $this->t('View !display_title', array('!display_title' => $display_title)), '#options' => array('alt' => array($this->t("Go to the real page for this display"))), + // @todo Use Url::fromPath() once + // https://www.drupal.org/node/2351379 is resolved. '#url' => Url::fromUri("base://$path"), '#prefix' => '
  • ', "#suffix" => '
  • ',