diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e478b461..9904d3c0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -143,4 +143,5 @@ Master Branch ============= - [Export list] improve alignment of last line +- [CRUD] Forward query parameters when pushing button "save and new" in "create" page; diff --git a/CRUD/Controller/CRUDController.php b/CRUD/Controller/CRUDController.php index 966d6f725..cbd4d55fd 100644 --- a/CRUD/Controller/CRUDController.php +++ b/CRUD/Controller/CRUDController.php @@ -994,12 +994,12 @@ class CRUDController extends AbstractController protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request) { $next = $request->request->get("submit", "save-and-close"); - + switch ($next) { case "save-and-close": return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_index'); case "save-and-new": - return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_new'); + return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_new', $request->query->all()); default: return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_view', [ 'id' => $entity->getId()