Skip to content

Commit 6b14137

Browse files
committed
minor #49667 [Form] Improve exception for unsubmitted form (KThiebault)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Form] Improve exception for unsubmitted form | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #49619 | License | MIT | Doc PR | - This PR improves the error message when a form is submitted but its submission is not verified. Commits ------- 51d3038 [Form] Improve exception for unsubmitted form
2 parents 163c570 + 51d3038 commit 6b14137

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ public function isEmpty(): bool
646646
public function isValid(): bool
647647
{
648648
if (!$this->submitted) {
649-
throw new LogicException('Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() before Form::isValid().');
649+
throw new LogicException('Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() and ensure that it\'s true before calling Form::isValid().');
650650
}
651651

652652
if ($this->isDisabled()) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy