Error message for wrong extension is displayed outside of the form and also does not get dismissed when doing anything else (except closing the modal) or even if a new error message appears.
Steps to recreate: Open entity browser and type a valid search term, click on an image that does not have the allowed file extension, the error will display (which is good). Then enter a new non valid search, and a new error will display, but the previous will still be there (not good).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3113504-2.patch | 2.94 KB | nejcramsak |
Comments
Comment #2
nejcramsak commentedRemoved ajax callbacks that displayed the wrong error messages and the issue is fixed.
Comment #3
deaom commentedHi @nejcramsak, the patch does apply and fixes the problem. The message now gets dismissed with the new message, but I noticed the location of the message is not the same as before and the call to pixabay search is not through ajax anymore. Maybe that is for the better not quite sure of the authors intentions so marking this as RTBC as it fixes the problem and does not change the actual functionality.
Comment #4
bcizej commentedI think for the moment this solution is ok. An alternative, ajax way of doing this would be to send an image validation request through ajax on form submit and if the response is good, proceed with normal form submission to actually select the image in the field.
I don't know if with entity browser it is possible to do form validation and submit through ajax. I've tried to do this, the ajax works ok but the field does not get populated with images.
So leaving this as RBTC for now.
Comment #6
slogar32 commentedThank you for your contributions! I'm marking this as fixed and closing the issue.
Comment #7
slogar32 commentedComment #8
slogar32 commentedComment #9
slogar32 commented