Skip to content

Commit a072b77

Browse files
committed
Handle save btn url
1 parent be163f7 commit a072b77

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/bundle/Controller/UserSettingsController.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,23 @@ public function updateAction(Request $request, UpdateView $view)
104104
'ibexa_user_settings'
105105
);
106106

107+
$returnUrl = $request->query->has('returnUrl') ? $request->query->get('returnUrl') : null;
108+
107109
if ($form->getClickedButton() instanceof Button
108110
&& $form->getClickedButton()->getName() === UserSettingUpdateType::BTN_UPDATE_AND_EDIT
109111
) {
110-
return $this->redirectToRoute('ibexa.user_settings.update', [
112+
$routeParams = [
111113
'identifier' => $data->getIdentifier(),
112-
]);
113-
}
114+
];
115+
116+
if ($returnUrl) {
117+
$routeParams['returnUrl'] = $returnUrl;
118+
}
114119

115-
if ($request->query->has('returnUrl')) {
116-
$returnUrl = $request->query->get('returnUrl');
120+
return $this->redirectToRoute('ibexa.user_settings.update', $routeParams);
121+
}
117122

123+
if ($returnUrl) {
118124
return $this->redirect($returnUrl);
119125
}
120126

0 commit comments

Comments
 (0)