diff --git a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php index c7d4641..0428083 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php @@ -70,7 +70,8 @@ public function checkRedirectUrl(FilterResponseEvent $event) { } else { // @todo This code path supports all destination strings that do not - // include the base path. Ideally we will be able to remove this. + // include the base path. Remove this in + // https://www.drupal.org/node/2418219. $destination = UrlHelper::parse($destination); $path = $destination['path']; $options['query'] = $destination['query']; diff --git a/core/modules/block_content/src/BlockContentListBuilder.php b/core/modules/block_content/src/BlockContentListBuilder.php index 731f2da..793428d 100644 --- a/core/modules/block_content/src/BlockContentListBuilder.php +++ b/core/modules/block_content/src/BlockContentListBuilder.php @@ -39,7 +39,7 @@ public function buildRow(EntityInterface $entity) { public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { - $operations['edit']['query']['destination'] = 'admin/structure/block/block-content'; + $operations['edit']['query']['destination'] = $entity->url('collection'); } return $operations; } diff --git a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php index 86921ec..c94f932 100644 --- a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -9,6 +9,7 @@ use Drupal\Core\Menu\LocalActionDefault; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Url; /** * Modifies the 'Add custom block' local action. @@ -26,7 +27,7 @@ public function getOptions(RouteMatchInterface $route_match) { } // Adds a destination on custom block listing. if ($route_match->getRouteName() == 'entity.block_content.collection') { - $options['query']['destination'] = 'admin/structure/block/block-content'; + $options['query']['destination'] = Url::fromRouteMatch($route_match)->toString(); } return $options; } diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php index ef884e1..86a2238 100644 --- a/core/modules/comment/src/CommentManager.php +++ b/core/modules/comment/src/CommentManager.php @@ -19,6 +19,7 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\Core\Url; use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\Entity\FieldConfig; @@ -260,7 +261,7 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) { // We cannot use drupal_get_destination() because these links // sometimes appear on /node and taxonomy listing pages. if ($entity->get($field_name)->getFieldDefinition()->getSetting('form_location') == CommentItemInterface::FORM_SEPARATE_PAGE) { - $destination = array('destination' => 'comment/reply/' . $entity->getEntityTypeId() . '/' . $entity->id() . '/' . $field_name . '#comment-form'); + $destination = ['destination' => Url::fromRoute('comment.reply', ['entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name], ['fragment' => 'comment-form'])->toString()]; } else { $destination = array('destination' => $entity->url('canonical', array('fragment' => 'comment-form'))); diff --git a/core/modules/config_translation/src/ConfigNamesMapper.php b/core/modules/config_translation/src/ConfigNamesMapper.php index b681b33..c630660 100644 --- a/core/modules/config_translation/src/ConfigNamesMapper.php +++ b/core/modules/config_translation/src/ConfigNamesMapper.php @@ -250,7 +250,7 @@ public function getOverviewRoute() { * {@inheritdoc} */ public function getOverviewPath() { - return Url::fromRoute($this->getOverviewRouteName(), $this->getOverviewRouteParameters())->getInternalPath(); + return Url::fromRoute($this->getOverviewRouteName(), $this->getOverviewRouteParameters())->toString(); } /** diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 363474d..37fc363 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -727,7 +727,7 @@ public function renderDisplayTop(ViewUI $view) { $element['extra_actions']['#links']['revert'] = array( 'title' => $this->t('Revert view'), 'href' => "admin/structure/views/view/{$view->id()}/revert", - 'query' => array('destination' => "admin/structure/views/view/{$view->id()}"), + 'query' => array('destination' => $view->url('edit-form')), ); } else {