diff --git a/CHANGELOG.md b/CHANGELOG.md index 01837a378..8f40d0ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,4 +103,6 @@ Master branch - [CRUD] add step delete - [CRUD] improve index view in person CRUD - [CRUD] filter by basis on person by default in EntityPersonCRUDController +- [CRUD] override relevant part of the main CRUD template +- [CRUD] fix redirection on person view: add a `person_id` to every page redirected. diff --git a/CRUD/Controller/EntityPersonCRUDController.php b/CRUD/Controller/EntityPersonCRUDController.php index f729f8b02..54ae006ee 100644 --- a/CRUD/Controller/EntityPersonCRUDController.php +++ b/CRUD/Controller/EntityPersonCRUDController.php @@ -117,15 +117,21 @@ class EntityPersonCRUDController extends CRUDController switch ($next) { case "save-and-close": return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_index', [ - 'person_id' => $entity->getPerson()->getId() + 'person_id' => $this->getPerson($request)->getId() ]); case "save-and-new": return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_new', [ - 'person_id' => $entity->getPerson()->getId() + 'person_id' => $this->getPerson($request)->getId() + ]); + case "new": + return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_view', [ + 'id' => $entity->getId(), + 'person_id' => $this->getPerson($request)->getId() ]); default: return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_view', [ - 'id' => $entity->getId() + 'id' => $entity->getId(), + 'person_id' => $this->getPerson($request)->getId() ]); } }