diff --git a/core/modules/shortcut/src/Entity/ShortcutHtmlRouteProvider.php b/core/modules/shortcut/src/Entity/ShortcutHtmlRouteProvider.php index 6f9ea13..bff6d72 100644 --- a/core/modules/shortcut/src/Entity/ShortcutHtmlRouteProvider.php +++ b/core/modules/shortcut/src/Entity/ShortcutHtmlRouteProvider.php @@ -31,10 +31,10 @@ public function getRoutes(EntityTypeInterface $entity_type) { */ protected function getAddFormRoute(EntityTypeInterface $entity_type) { if ($route = parent::getAddFormRoute($entity_type)) { - $route - ->setDefault('_title_callback', FALSE) - ->setDefault('_title', 'Add link'); - return $route; + $defaults = $route->getDefaults(); + unset($defaults['_title_callback']); + $defaults['_title'] = 'Add link'; + return $route->setDefaults($defaults); } } @@ -52,10 +52,10 @@ protected function getCanonicalRoute(EntityTypeInterface $entity_type) { */ protected function getEditFormRoute(EntityTypeInterface $entity_type) { if ($route = parent::getEditFormRoute($entity_type)) { - $route - ->setDefault('_title_callback', FALSE) - ->setDefault('_title', 'Edit'); - return $route; + $defaults = $route->getDefaults(); + unset($defaults['_title_callback']); + $defaults['_title'] = 'Edit'; + return $route->setDefaults($defaults); } }