Skip to content

Commit 438215e

Browse files
authored
bug #281 Fix of SymfonyForm error (oallain, GSadee)
This PR was merged into the 1.5 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.5 | Bug fix? | yes | New feature? | no | Related tickets | Fix of error : ``` request.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\LogicException: "Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() before Form::isValid()." at /home/site/vendor/symfony/form/Form.php line 765 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\LogicException(code: 0): Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() before Form::isValid(). at /home/site/vendor/symfony/form/Form.php:765)"} [] ``` Commits ------- 250c404 Fix of SymfonyForm error a88d022 Merge branch '1.5' into oallain-patch-1
2 parents e91c804 + a88d022 commit 438215e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Controller/PayPalOrderItemController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function createFromProductDetailsAction(Request $request): Response
3939

4040
$form = $form->handleRequest($request);
4141

42-
if (!$form->isValid()) {
42+
if ($form->isSubmitted() && !$form->isValid()) {
4343
return new RedirectResponse((string) $request->headers->get('referer'));
4444
}
4545

0 commit comments

Comments
 (0)