Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment stating isSubmitted is optional #1443

Merged
merged 1 commit into from Oct 23, 2023

Conversation

smnandre
Copy link
Contributor

The isSubmitted() must be called before

src/Symfony/Component/Form/Form.php

    public function isValid(): bool
    {
        if (!$this->submitted) {
            throw new LogicException('Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() and ensure that it\'s true before calling Form::isValid().');
        }

        if ($this->isDisabled()) {
            return true;
        }

        return 0 === \count($this->getErrors(true));
    }

@javiereguiluz
Copy link
Member

Another good catch! Thanks Simon 🙌

@javiereguiluz javiereguiluz merged commit 23ff699 into symfony:main Oct 23, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants