Reload form after persisting part changes, so the SIUnitType shows the correct unit.

This commit is contained in:
Jan Böhmer 2019-08-26 11:55:37 +02:00
parent 03c1d35887
commit 0cc95f58da

View file

@ -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'));
}