GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Fix the select elements duplication in case of validation error.
You are removing DOM inserting here, why ?
Can you explain how to reproduce the behavior ?
You are right, I should keep the inserted span. BTW there is still an issue with the following code :
target = jQuery('span', element);
If more than one span are in the element, the input (select) field will be duplicated because of this code :
Let me update my PR.
Fix select duplication
I just updated my PR. I wrap the select with a span, then I choose this span as qtip target.
Can you tell me how to reproduce this issue ?
This happens on sonata_type_model form fields. I reproduced the issue in the sandbox.
In the PostAdmin, add an empty_value and remove the required option to the author field :
->add('author', 'sonata_type_model', array('empty_value' => '', 'required' => false))
Then in the Post entity validation.xml file, set the author to be not null :
<constraint name="NotNull" />
Now create (or update) a post without selecting an author : the field should be here 3 times, making update impossible.
cherry picked and merged into 2.1/master