mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
[CRUD] Forward query parameters when pushing button "save and new" in "create" page
This commit is contained in:
parent
a732393100
commit
567f3f7ec9
@ -143,4 +143,5 @@ Master Branch
|
|||||||
=============
|
=============
|
||||||
|
|
||||||
- [Export list] improve alignment of last line
|
- [Export list] improve alignment of last line
|
||||||
|
- [CRUD] Forward query parameters when pushing button "save and new" in "create" page;
|
||||||
|
|
||||||
|
@ -994,12 +994,12 @@ class CRUDController extends AbstractController
|
|||||||
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
||||||
{
|
{
|
||||||
$next = $request->request->get("submit", "save-and-close");
|
$next = $request->request->get("submit", "save-and-close");
|
||||||
|
|
||||||
switch ($next) {
|
switch ($next) {
|
||||||
case "save-and-close":
|
case "save-and-close":
|
||||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_index');
|
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_index');
|
||||||
case "save-and-new":
|
case "save-and-new":
|
||||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_new');
|
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_new', $request->query->all());
|
||||||
default:
|
default:
|
||||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_view', [
|
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_view', [
|
||||||
'id' => $entity->getId()
|
'id' => $entity->getId()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user