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).

CommentFileSizeAuthor
#2 3113504-2.patch2.94 KBnejcramsak

Comments

DeaOm created an issue. See original summary.

nejcramsak’s picture

Status: Active » Needs review
StatusFileSize
new2.94 KB

Removed ajax callbacks that displayed the wrong error messages and the issue is fixed.

deaom’s picture

Status: Needs review » Reviewed & tested by the community

Hi @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.

bcizej’s picture

I 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.

  • slogar32 committed 1a3d649 on 8.x-1.x authored by nejcramsak
    Issue #3113504 by nejcramsak: Error mesage does not get dismissed
    
slogar32’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your contributions! I'm marking this as fixed and closing the issue.

slogar32’s picture

Status: Fixed » Closed (fixed)
slogar32’s picture

slogar32’s picture