fix person validation

This commit is contained in:
2021-12-16 21:39:59 +01:00
parent 400ce3ac82
commit 06cbe8325c
5 changed files with 10 additions and 31 deletions

View File

@@ -20,7 +20,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Role\Role;
use function array_filter;
use function array_values;

View File

@@ -131,6 +131,8 @@ final class PersonController extends AbstractController
->getFlashBag()->add('error', $this->translator
->trans('This form contains errors'));
} elseif ($form->isSubmitted() && $form->isValid()) {
$this->em->flush();
$this->get('session')->getFlashBag()
->add(
'success',
@@ -138,8 +140,6 @@ final class PersonController extends AbstractController
->trans('The person data has been updated')
);
$this->em->flush();
return $this->redirectToRoute('chill_person_view', [
'person_id' => $person->getId(),
]);