mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
fix: handle request so errors can be displayed
This is a long time fix :)
This commit is contained in:
parent
385a5e501f
commit
dd73511008
1 changed files with 33 additions and 29 deletions
|
|
@ -46,7 +46,10 @@ final class ContactController
|
|||
$formType = $this->getSyliusAttribute($request, 'form', ContactType::class);
|
||||
$form = $this->formFactory->create($formType, null, $this->getFormOptions());
|
||||
|
||||
if ($request->isMethod('POST') && $form->handleRequest($request)->isSubmitted() && $form->isValid()) {
|
||||
if ($request->isMethod('POST')) {
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var mixed $data */
|
||||
$data = $form->getData();
|
||||
Assert::isArray($data);
|
||||
|
|
@ -89,6 +92,7 @@ final class ContactController
|
|||
|
||||
return new RedirectResponse($this->router->generate($redirectRoute));
|
||||
}
|
||||
}
|
||||
|
||||
$template = $this->getSyliusAttribute($request, 'template', '@SyliusShop/contact/contact_request.html.twig');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue