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

Freetext fields have required constraints #379

Closed
oprichnik opened this issue May 9, 2024 · 2 comments · Fixed by #380
Closed

Freetext fields have required constraints #379

oprichnik opened this issue May 9, 2024 · 2 comments · Fixed by #380

Comments

@oprichnik
Copy link
Contributor

Q A
Bug? Yes
New Feature? no
Bundle Version 2.5.2
Sulu Version 2.5.10
Browser Version Firefox 125

Actual Behavior

When switching from a field with the "required" radio set, to a "freetext" field, the "required" radio disappears but the behaviour is still there and submitting the form trigger a required error on that field

Expected Behavior

No required constraint on freetext fields

Steps to Reproduce

  1. Create a classic field and set the "required" on.
  2. Switch this field to a "freetext" field
  3. Save the form
  4. Create a page including this form and try to send the form

Possible Solutions

Do not put any constraint on freetext fields

image

@alexander-schranz
Copy link
Member

@oprichnik Thank you for the report I think we should do a check here for HiddenType::class to not set hidden fields with a notblank constraint:

if ($field->getRequired()) {

Do you want to create a pull request for it.

@oprichnik
Copy link
Contributor Author

Here it is: #380

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 a pull request may close this issue.

2 participants