From 4150be996771c8d6f5c9cf0748bfe651a1dab5dd Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 10 Aug 2021 13:18:23 +0200 Subject: [PATCH 1/5] IBX-862: Translation action originating from chosen location --- src/bundle/Controller/TranslationController.php | 1 + src/bundle/Resources/config/routing.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bundle/Controller/TranslationController.php b/src/bundle/Controller/TranslationController.php index c59b983010..6be712fbec 100644 --- a/src/bundle/Controller/TranslationController.php +++ b/src/bundle/Controller/TranslationController.php @@ -86,6 +86,7 @@ public function addAction(Request $request): Response return new RedirectResponse($this->generateUrl('ezplatform.content.translate', [ 'contentId' => $contentInfo->id, + 'locationId' => $location->id, 'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null, 'toLanguageCode' => $language->languageCode, ])); diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index 111fa9a198..7bef25c5fe 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -564,7 +564,7 @@ ezplatform.content.preview: locationId: ~ ezplatform.content.translate: - path: /content/{contentId}/translate/{toLanguageCode}/{fromLanguageCode} + path: /content/{contentId}/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} methods: ['GET', 'POST'] defaults: _controller: 'EzPlatformAdminUiBundle:ContentEdit:translate' From 32e55e3061f15500fc1418aabe682c2f6a53bfa8 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 31 Aug 2021 18:14:07 +0200 Subject: [PATCH 2/5] IBX-862: Created new route with location required --- src/bundle/Controller/TranslationController.php | 2 +- src/bundle/Resources/config/routing.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bundle/Controller/TranslationController.php b/src/bundle/Controller/TranslationController.php index 6be712fbec..963a5f76fc 100644 --- a/src/bundle/Controller/TranslationController.php +++ b/src/bundle/Controller/TranslationController.php @@ -84,7 +84,7 @@ public function addAction(Request $request): Response $language = $data->getLanguage(); $baseLanguage = $data->getBaseLanguage(); - return new RedirectResponse($this->generateUrl('ezplatform.content.translate', [ + return new RedirectResponse($this->generateUrl('ezplatform.content.translate_with_location', [ 'contentId' => $contentInfo->id, 'locationId' => $location->id, 'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null, diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index 7bef25c5fe..35acbc3e16 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -564,7 +564,14 @@ ezplatform.content.preview: locationId: ~ ezplatform.content.translate: - path: /content/{contentId}/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} + path: /content/{contentId}/translate/{toLanguageCode}/{fromLanguageCode} + methods: ['GET', 'POST'] + defaults: + _controller: 'EzPlatformAdminUiBundle:ContentEdit:translate' + fromLanguageCode: ~ + +ezplatform.content.translate_with_location: + path: /content/{contentId}/location/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} methods: ['GET', 'POST'] defaults: _controller: 'EzPlatformAdminUiBundle:ContentEdit:translate' From fa1da2c0cb75b6e12eb3f1a9c87247cf6c2157cc Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Wed, 1 Sep 2021 11:13:56 +0200 Subject: [PATCH 3/5] IBX-862: Updated route name --- src/bundle/Controller/TranslationController.php | 2 +- src/bundle/Resources/config/routing.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundle/Controller/TranslationController.php b/src/bundle/Controller/TranslationController.php index 963a5f76fc..6858d3f4d7 100644 --- a/src/bundle/Controller/TranslationController.php +++ b/src/bundle/Controller/TranslationController.php @@ -84,7 +84,7 @@ public function addAction(Request $request): Response $language = $data->getLanguage(); $baseLanguage = $data->getBaseLanguage(); - return new RedirectResponse($this->generateUrl('ezplatform.content.translate_with_location', [ + return new RedirectResponse($this->generateUrl('ibexa.content.translate_with_location', [ 'contentId' => $contentInfo->id, 'locationId' => $location->id, 'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null, diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index 35acbc3e16..391ae70940 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -570,7 +570,7 @@ ezplatform.content.translate: _controller: 'EzPlatformAdminUiBundle:ContentEdit:translate' fromLanguageCode: ~ -ezplatform.content.translate_with_location: +ibexa.content.translate_with_location: path: /content/{contentId}/location/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} methods: ['GET', 'POST'] defaults: From 2aa6dcc6f6ea0b71c0b894c7738cbd0de2f61904 Mon Sep 17 00:00:00 2001 From: barw4 Date: Mon, 6 Sep 2021 14:30:17 +0200 Subject: [PATCH 4/5] IBX-862: Applied review remark --- src/bundle/Resources/config/routing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index 391ae70940..feb47cce0b 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -574,7 +574,7 @@ ibexa.content.translate_with_location: path: /content/{contentId}/location/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} methods: ['GET', 'POST'] defaults: - _controller: 'EzPlatformAdminUiBundle:ContentEdit:translate' + _controller: '\EzSystems\EzPlatformAdminUiBundle\Controller\ContentEditController::translateAction' fromLanguageCode: ~ ezplatform.content.check_edit_permission: From 645b3712cae4d0cfe95007cf830db54199090c22 Mon Sep 17 00:00:00 2001 From: barw4 Date: Mon, 6 Sep 2021 14:48:58 +0200 Subject: [PATCH 5/5] IBX-862: Applied review remark --- src/bundle/Resources/config/routing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index feb47cce0b..20652d9f9c 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -574,7 +574,7 @@ ibexa.content.translate_with_location: path: /content/{contentId}/location/{locationId}/translate/{toLanguageCode}/{fromLanguageCode} methods: ['GET', 'POST'] defaults: - _controller: '\EzSystems\EzPlatformAdminUiBundle\Controller\ContentEditController::translateAction' + _controller: 'EzSystems\EzPlatformAdminUiBundle\Controller\ContentEditController::translateAction' fromLanguageCode: ~ ezplatform.content.check_edit_permission: