Skip to content

[DomCrawler] Make ChoiceFormField::isDisabled return true for unchecked disabled checkboxes #59399

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

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

MatTheCat
Copy link
Contributor

@MatTheCat MatTheCat commented Jan 7, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #8348
License MIT

ChoiceFormField::isDisabled’s PHPDoc reads

Check if the current selected option is disabled.

But a checkbox really embeds two options: either you check it, or not; which means it always has a selected option.
Then, if a checkbox is disabled, these two options are too.
So, ChoiceFormField::isDisabled should return true for disabled checkboxes, checked or not.

This also matches what you intuitively would expect from this method.

@carsonbot carsonbot added this to the 6.4 milestone Jan 7, 2025
@MatTheCat MatTheCat changed the title [DomCrawler] Make ChoiceFormField::isDisabled return true for disabled checkboxes [DomCrawler] Make ChoiceFormField::isDisabled return true for unchecked disabled checkboxes Jan 7, 2025
@nicolas-grekas
Copy link
Member

Thank you @MatTheCat.

@nicolas-grekas nicolas-grekas merged commit cb5fdaf into symfony:6.4 Jan 22, 2025
11 checks passed
@MatTheCat MatTheCat deleted the ticket_8348 branch January 22, 2025 15:06
This was referenced Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants