feat: return to detail view after editing accommodation booking

This commit is contained in:
Björn Fromme
2026-08-19 15:39:30 +02:00
parent 7b0bf9ec94
commit 6cdb331aae
3 changed files with 21 additions and 3 deletions
@@ -135,7 +135,17 @@ class EditController extends AbstractController
'groupName' => $booking->getGroupName(),
]);
return $this->redirectToRoute('app_admin_accommodationbooking_edit', ['id' => $booking->getId()]);
// Back to the detail page rather than the form: that is where every named status
// action lives, so it is the view a manager needs after saving. The return url is
// forwarded still encoded, the way return_url() handed it over, so that the detail
// page's "zurück" leads to the filtered list the edit was started from.
$parameters = ['id' => $booking->getId()];
$returnUrl = $request->query->getString('r');
if ('' !== $returnUrl) {
$parameters['r'] = $returnUrl;
}
return $this->redirectToRoute('app_admin_accommodationbooking_show', $parameters);
}
return $this->render('admin/accommodation_booking/edit.html.twig', [