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 ...@@ -106,8 +106,8 @@ class UserPrestataireController extends FluxController
} }
} else { } else {
foreach ($form->getErrors(true, true) as $error) { foreach ($form->getErrors(true, true) as $error) {
// Add flash error message in case of error with the embedded form // Errors detected here can be productFamily errors or other errors like csrf token errors
if (str_contains($error->getCause()->getPropertyPath(), 'productFamily')) { // Add flash message showing the first error message
$this->addFlash( $this->addFlash(
'error', 'error',
$error->getMessage() $error->getMessage()
...@@ -115,7 +115,6 @@ class UserPrestataireController extends FluxController ...@@ -115,7 +115,6 @@ class UserPrestataireController extends FluxController
break; break;
} }
} }
}
return $this->redirectToRoute('index'); 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