You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you update the contents of the Select2 via Ajax and the backing model has updated but the front end has not, it can be possible for the Select2 to send a meaningless input to the server. The provider getProvider() is expected to always return an option server side, while the input might not have made sense.
Instead of calling iterator().next() it should check if there is indeed an answer, if the backing provider finds the input valid.
The text was updated successfully, but these errors were encountered:
The Select2Choice class in the convertInput method expects the provider to give an answer given an input on line 54:
setConvertedInput(getProvider().toChoices(Collections.singleton(input)).iterator().next());
If you update the contents of the Select2 via Ajax and the backing model has updated but the front end has not, it can be possible for the Select2 to send a meaningless input to the server. The provider getProvider() is expected to always return an option server side, while the input might not have made sense.
Instead of calling iterator().next() it should check if there is indeed an answer, if the backing provider finds the input valid.
The text was updated successfully, but these errors were encountered: