-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
remove select required attribute #4498
Conversation
Please associate your meta.ua email address with your Github account, or change the email in your commits to an address already associated with it. |
@@ -19,7 +19,6 @@ file that was distributed with this source code. | |||
<select id="{{ id }}_autocomplete_input_v4" data-sonata-select2="false" | |||
{%- if read_only is defined and read_only %} readonly="readonly"{% endif -%} | |||
{%- if disabled %} disabled="disabled"{% endif -%} | |||
{%- if required %} required="required"{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This select does not have a name
attribute. I think the right fix might be to specify one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name attribute present in input type='hidden' element.
https://github.com/sonata-project/SonataAdminBundle/blob/3.x/Resources/views/Form/Type/sonata_type_model_autocomplete.html.twig#L32
If you define name attribute for select element - then this value will be sent to the server that is undesirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't select2 supposed to remove it just before submit? Not sure why we are building the hidden fields ourselves either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure they are even supposed to be there anymore : https://select2.github.io/announcements-4.0.html#hidden-input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the hidden input element must be deleted! In this regard, Im close this pull request.
I am targeting this branch, because it is patch.
Closes #4022, #4486
Changelog
Subject
Fix problem with required autocomplete field on save from.