diff --git a/core/modules/config_translation/src/ConfigEntityMapper.php b/core/modules/config_translation/src/ConfigEntityMapper.php index 2cbc78e..7531b66 100644 --- a/core/modules/config_translation/src/ConfigEntityMapper.php +++ b/core/modules/config_translation/src/ConfigEntityMapper.php @@ -163,6 +163,25 @@ public function getBaseRouteParameters() { } /** + * {@inheritdoc} + */ + public function getBaseEditRouteName() { + return $this->entityManager->getDefinition($this->entityType)->getLinkTemplate('edit-form'); + } + + /** + * {@inheritdoc} + */ + public function getBaseEditRoute() { + if ($this->routeCollection) { + return $this->routeCollection->get($this->getBaseEditRouteName()); + } + else { + return $this->routeProvider->getRouteByName($this->getBaseEditRouteName()); + } + } + + /** * Set entity type for this mapper. * * This should be set in initialization. A mapper that knows its type but diff --git a/core/modules/config_translation/src/ConfigMapperInterface.php b/core/modules/config_translation/src/ConfigMapperInterface.php index ba75aa2..bf28cd1 100644 --- a/core/modules/config_translation/src/ConfigMapperInterface.php +++ b/core/modules/config_translation/src/ConfigMapperInterface.php @@ -64,6 +64,29 @@ public function getBaseRoute(); public function getBasePath(); /** + * Returns route name for the edit route. + * + * @return string + * Route name for the mapper. + */ + public function getBaseEditRouteName(); + + /** + * Returns the route parameters for the edit form route. + * + * @return array + */ + public function getBaseEditRouteParameters(); + + /** + * Returns the route object for the edit form route. + * + * @return \Symfony\Component\Routing\Route + * The route object for the translation page. + */ + public function getBaseEditRoute(); + + /** * Returns route name for the translation overview route. * * @return string @@ -118,7 +141,7 @@ public function getAddRouteParameters(); public function getAddRoute(); /** - * Returns route name for the translation edit form route. + * Returns route name for the translation route. * * @return string * Route name for the mapper. @@ -126,14 +149,14 @@ public function getAddRoute(); public function getEditRouteName(); /** - * Returns the route parameters for the translation edit form route. + * Returns the route parameters for the translation route. * * @return array */ public function getEditRouteParameters(); /** - * Returns the route object for a translation edit form route. + * Returns the route object for the translation route. * * @return \Symfony\Component\Routing\Route * The route object for the translation page. diff --git a/core/modules/config_translation/src/ConfigNamesMapper.php b/core/modules/config_translation/src/ConfigNamesMapper.php index ed796af..8b95e5c 100644 --- a/core/modules/config_translation/src/ConfigNamesMapper.php +++ b/core/modules/config_translation/src/ConfigNamesMapper.php @@ -189,6 +189,27 @@ public function getBaseRoute() { } /** + * {@inheritdoc} + */ + public function getBaseEditRouteName() { + return $this->getBaseRouteName(); + } + + /** + * {@inheritdoc} + */ + public function getBaseEditRouteParameters() { + return $this->getBaseRouteParameters(); + } + + /** + * {@inheritdoc} + */ + public function getBaseEditRoute() { + return $this->getBaseRoute(); + } + + /** * Allows to process all config translation routes. * * @param \Symfony\Component\Routing\Route $route diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationController.php b/core/modules/config_translation/src/Controller/ConfigTranslationController.php index 72fe9cc..c9eb31f 100644 --- a/core/modules/config_translation/src/Controller/ConfigTranslationController.php +++ b/core/modules/config_translation/src/Controller/ConfigTranslationController.php @@ -175,7 +175,7 @@ public function itemPage(Request $request, RouteMatchInterface $route_match, $pl if ($edit_access) { $operations['edit'] = array( 'title' => $this->t('Edit'), - 'url' => Url::fromRoute($mapper->getBaseRouteName(), $mapper->getBaseRouteParameters(), ['query' => ['destination' => $mapper->getOverviewPath()]]), + 'url' => Url::fromRoute($mapper->getBaseEditRouteName(), $mapper->getBaseEditRouteParameters(), ['query' => ['destination' => $mapper->getOverviewPath()]]), ); } }