diff --git a/core/lib/Drupal/Core/Form/DialogFormTrait.php b/core/lib/Drupal/Core/Form/DialogFormTrait.php index 3d4d884a50..3142010f21 100644 --- a/core/lib/Drupal/Core/Form/DialogFormTrait.php +++ b/core/lib/Drupal/Core/Form/DialogFormTrait.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Form; +use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Ajax\RedirectCommand; use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; @@ -177,7 +178,8 @@ protected function getRedirectUrl() { */ protected function getDestinationUrl() { if ($destination = $this->getRedirectDestinationPath()) { - return Url::fromUserInput('/' . $destination); + $options = UrlHelper::parse($destination); + return Url::fromUserInput('/' . ltrim($options['path'], '/'), $options); } }