diff -u b/redirect.module b/redirect.module --- b/redirect.module +++ b/redirect.module @@ -501,16 +501,22 @@ ]; } + $current_page = Url::fromRoute(''); $form['url_redirects']['actions'] = [ '#theme' => 'links', '#links' => [], '#attributes' => ['class' => ['action-links']], ]; - $form['url_redirects']['actions']['#links']['add'] = [ 'title' => t('Add URL redirect to this node'), - 'url' => Url::fromRoute('redirect.add', ['redirect' => '/node/' . $nid, 'destination' => '/node/' . $nid]), - 'attributes' => ['target' => '_blank'], + 'url' => Url::fromRoute('redirect.add', [ + 'redirect' => "/node/$nid", + 'destination' => $current_page->toString(), + ]), + 'attributes' => [ + 'class' => 'button', + 'target' => '_blank', + ], ]; } }