Commit ec629e96 by Yvon

infos prestataire form : add flash message no matter what is class of form error cause

parent b96970ea
......@@ -106,8 +106,8 @@ class UserPrestataireController extends FluxController
}
} else {
foreach ($form->getErrors(true, true) as $error) {
// Add flash error message in case of error with the embedded form
if (str_contains($error->getCause()->getPropertyPath(), 'productFamily')) {
// Errors detected here can be productFamily errors or other errors like csrf token errors
// Add flash message showing the first error message
$this->addFlash(
'error',
$error->getMessage()
......@@ -115,7 +115,6 @@ class UserPrestataireController extends FluxController
break;
}
}
}
return $this->redirectToRoute('index');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment