Commit ec629e96 by Yvon

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

parent b96970ea
......@@ -106,14 +106,13 @@ 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')) {
$this->addFlash(
'error',
$error->getMessage()
);
break;
}
// 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()
);
break;
}
}
......
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