Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-862: Fixed translation action originating from non-main Location #1845

Merged
merged 5 commits into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bundle/Controller/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ 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('ibexa.content.translate_with_location', [
'contentId' => $contentInfo->id,
'locationId' => $location->id,
'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null,
'toLanguageCode' => $language->languageCode,
]));
Expand Down
7 changes: 7 additions & 0 deletions src/bundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ ezplatform.content.translate:
_controller: 'EzPlatformAdminUiBundle:ContentEdit:translate'
fromLanguageCode: ~

ibexa.content.translate_with_location:
path: /content/{contentId}/location/{locationId}/translate/{toLanguageCode}/{fromLanguageCode}
methods: ['GET', 'POST']
defaults:
_controller: 'EzPlatformAdminUiBundle:ContentEdit:translate'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a legacy way of referencing controllers?

Using FQCN is recommended afaik.

fromLanguageCode: ~

ezplatform.content.check_edit_permission:
path: /content/{contentId}/check-edit-permission/{languageCode}
options:
Expand Down