diff -u b/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php --- b/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -33,7 +33,7 @@ * }, * "translation" = "Drupal\content_translation\ContentTranslationHandler", * "route_provider" = { - * "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider", + * "html" = "Drupal\shortcut\ShortcutHtmlRouteProvider", * }, * }, * base_table = "shortcut", --- b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php +++ a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php @@ -166,7 +166,7 @@ $shortcuts = $set->getShortcuts(); $shortcut = reset($shortcuts); + $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id(), array('title[0][value]' => $new_link_name), t('Save')); - $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id() . '/edit', array('title[0][value]' => $new_link_name), t('Save')); $saved_set = ShortcutSet::load($set->id()); $titles = $this->getShortcutInformation($saved_set, 'title'); $this->assertTrue(in_array($new_link_name, $titles), 'Shortcut renamed: ' . $new_link_name); @@ -185,7 +185,7 @@ $shortcuts = $set->getShortcuts(); $shortcut = reset($shortcuts); + $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id(), array('title[0][value]' => $shortcut->getTitle(), 'link[0][uri]' => $new_link_path), t('Save')); - $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id() . '/edit', array('title[0][value]' => $shortcut->getTitle(), 'link[0][uri]' => $new_link_path), t('Save')); $saved_set = ShortcutSet::load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'link'); $this->assertTrue(in_array('internal:' . $new_link_path, $paths), 'Shortcut path changed: ' . $new_link_path); --- /dev/null +++ b/core/modules/shortcut/src/ShortcutHtmlRouteProvider.php @@ -0,0 +1,35 @@ +id(); + $route + ->setDefaults([ + '_entity_form' => "{$entity_type_id}.default", + '_title_callback', 'Drupal\Core\Entity\Controller\EntityController::editTitle' + ]) + ->setRequirement('_entity_access', "{$entity_type_id}.update"); + + return $route; + } + } + +}