diff --git a/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php b/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php
index 6424ff9f9d..e8976016e0 100644
--- a/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php
+++ b/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php
@@ -3,64 +3,32 @@
 namespace Drupal\menu_ui\Plugin\Menu\LocalAction;
 
 use Drupal\Core\Menu\LocalActionDefault;
-use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Routing\RouteProviderInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\system\MenuInterface;
 
 /**
  * Modifies the 'Add link' local action to add a destination.
  */
 class MenuLinkAdd extends LocalActionDefault {
 
-  /**
-   * The redirect destination.
-   *
-   * @var \Drupal\Core\Routing\RedirectDestinationInterface
-   */
-  private $redirectDestination;
-
-  /**
-   * Constructs a MenuLinkAdd object.
-   *
-   * @param array $configuration
-   *   A configuration array containing information about the plugin instance.
-   * @param string $plugin_id
-   *   The plugin_id for the plugin instance.
-   * @param mixed $plugin_definition
-   *   The plugin implementation definition.
-   * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
-   *   The route provider to load routes by name.
-   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
-   *   The redirect destination.
-   */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteProviderInterface $route_provider, RedirectDestinationInterface $redirect_destination) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition, $route_provider);
-
-    $this->redirectDestination = $redirect_destination;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
-    return new static(
-      $configuration,
-      $plugin_id,
-      $plugin_definition,
-      $container->get('router.route_provider'),
-      $container->get('redirect.destination')
-    );
-  }
-
   /**
    * {@inheritdoc}
    */
   public function getOptions(RouteMatchInterface $route_match) {
     $options = parent::getOptions($route_match);
-    // Append the current path as destination to the query string.
-    $options['query']['destination'] = $this->redirectDestination->get();
+    if ($route_match->getParameter('menu') instanceof MenuInterface) {
+      // Append the current path as destination to the query string.
+      $options['query']['destination'] = $route_match->getParameter('menu')->toUrl('edit-form')->toString();
+    }
     return $options;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getCacheContexts() {
+    return ['url.path'];
+  }
+
+
 }
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index dde95027bd..959e21458b 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -5,6 +5,7 @@
 use Drupal\block\Entity\Block;
 use Drupal\Component\Serialization\Json;
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Cache\Cache;
 use Drupal\Core\Menu\MenuLinkInterface;
 use Drupal\Core\Url;
 use Drupal\menu_link_content\Entity\MenuLinkContent;
@@ -66,6 +67,10 @@ protected function setUp() {
     parent::setUp();
 
     $this->drupalPlaceBlock('page_title_block');
+    $this->drupalPlaceBlock('local_actions_block', [
+      'region' => 'content',
+      'weight' => -100,
+    ]);
 
     $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
 
@@ -258,11 +263,25 @@ public function deleteCustomMenu() {
    * Tests menu functionality.
    */
   public function doMenuTests() {
+    // Add a link to the tools menu first, to test cacheablity metadata of the
+    // destination query string.
+    $this->drupalGet('admin/structure/menu/manage/tools');
+    $this->clickLink(t('Add link'));
+    $link_title = $this->randomString();
+    $this->drupalPostForm(NULL, ['link[0][uri]' => '/', 'title[0][value]' => $link_title], t('Save'));
+    $this->assertUrl('admin/structure/menu/manage/tools');
+
     $menu_name = $this->menu->id();
 
+    // Access the menu via the overview form.
+    $this->drupalGet('admin/structure/menu');
+
+    // Select the edit menu link for our menu.
+    $link_label = t('Edit menu');
+    $links = $this->xpath('//*/td[contains(text(),:menu_label)]/following::a[normalize-space()=:link_label]', [':menu_label' => $this->menu->label(), ':link_label' => $link_label]);
+    $this->drupalGet($this->getAbsoluteUrl($links[0]['href']));
+
     // Test the 'Add link' local action.
-    $this->drupalGet(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
-
     $this->clickLink(t('Add link'));
     $link_title = $this->randomString();
     $this->drupalPostForm(NULL, ['link[0][uri]' => '/', 'title[0][value]' => $link_title], t('Save'));
