mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Reload form after persisting part changes, so the SIUnitType shows the correct unit.
This commit is contained in:
parent
03c1d35887
commit
0cc95f58da
1 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,9 @@ class PartController extends AbstractController
|
||||||
$em->persist($part);
|
$em->persist($part);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
$this->addFlash('info', $translator->trans('part.edited_flash'));
|
$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()) {
|
} elseif ($form->isSubmitted() && ! $form->isValid()) {
|
||||||
$this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
|
$this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue