Commit 677269b1 by Damien Moulard

Merge branch '6332-fix-error-which-occured-just-before-app-blackout' into 'develop'

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

See merge request cooperatic/kohinos-tav!97
parents b96970ea ec629e96
...@@ -106,14 +106,13 @@ class UserPrestataireController extends FluxController ...@@ -106,14 +106,13 @@ 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()
); );
break; 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