diff -u b/redirect.module b/redirect.module --- b/redirect.module +++ b/redirect.module @@ -504,7 +504,6 @@ } $type = NodeType::load($node->getType()); - $current_page = Url::fromRoute(''); $form['url_redirects']['actions'] = [ '#theme' => 'links', '#links' => [], @@ -514,7 +513,7 @@ 'title' => t('Add URL redirect to this %type', ['%type' => $type->label()]), 'url' => Url::fromRoute('redirect.add', [ 'redirect' => "/node/$nid", - 'destination' => $current_page->toString(), + 'destination' => \Drupal::destination()->get(), ]), 'attributes' => [ 'class' => 'button',