Skip to content

Commit

Permalink
Added routeParameters for custom route
Browse files Browse the repository at this point in the history
  • Loading branch information
Gengar-i committed Apr 5, 2024
1 parent 5f28267 commit 5cdcef0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/bundle/Controller/UserSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,28 +105,20 @@ public function updateAction(Request $request, UpdateView $view)
);

$route = $request->query->get('route') ?? null;
$contentId = $request->query->get('contentId') ?? null;
$versionNo = $request->query->get('versionNo') ?? null;
$language = $request->query->get('language') ?? null;
$routeParameters = $request->query->get('routeParameters') ?? [];

if ($form->getClickedButton() instanceof Button
&& $form->getClickedButton()->getName() === UserSettingUpdateType::BTN_UPDATE_AND_EDIT
) {
return $this->redirectToRoute('ibexa.user_settings.update', [
'identifier' => $data->getIdentifier(),
'route' => $route,
'contentId' => $contentId,
'versionNo' => $versionNo,
'language' => $language,
'routeParameters' => $routeParameters,
]);
}

if ($route !== null) {
return $this->redirectToRoute($route, [
'contentId' => $contentId,
'versionNo' => $versionNo,
'language' => $language,
]);
return $this->redirectToRoute($route, $routeParameters);
}

return new RedirectResponse($this->generateUrl('ibexa.user_settings.list'));
Expand Down

0 comments on commit 5cdcef0

Please sign in to comment.