From 0cc95f58da3cf3956b2e1770cefa70bae2dca996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 26 Aug 2019 11:55:37 +0200 Subject: [PATCH] Reload form after persisting part changes, so the SIUnitType shows the correct unit. --- src/Controller/PartController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 75a418d2..5ede844f 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -81,6 +81,9 @@ class PartController extends AbstractController $em->persist($part); $em->flush(); $this->addFlash('info', $translator->trans('part.edited_flash')); + + //Reload form, so the SIUnitType entries use the new part unit + $form = $this->createForm(PartBaseType::class, $part); } elseif ($form->isSubmitted() && ! $form->isValid()) { $this->addFlash('error', $translator->trans('part.edited_flash.invalid')); }