Opened 5 years ago
Last modified 5 years ago
#48784 reopened defect (bug)
Search box in Select / Upload image pop-up not working with cropped images
Reported by: | javierr | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Media | Keywords: | |
Focuses: | ui, javascript, template | Cc: |
Description
Hi, it seems that the search field in the pop-up of selecting or uploading images can not find the images which have been cropped before. For example, if I go to Appearance / Customize and want to change the Logo image, and I am asked to cropped the image, that image won't show in the search field. It will show the non cropped image, but not the cropped one.
Thank you!
In the attached image you can see how the search field can do find the filename "Foto-de-Javier-1.jpg" using just the letters "jav". But there is another image in the Media which name is "cropped-Foto-de-Javier-1.jpg" and this one does not appear.
Attachments (1)
Change History (6)
#2
@
5 years ago
- Resolution set to invalid
- Status changed from new to closed
Nice catch! I confirm the issue.
Steps to replicate:
- clean wordpres installation with default theme
- login as admin
- go to wp-admin > apperance > customize > site identity
- click logo button
- upload some image from disc and remember its name
- choose option to add this image
- you will see image cropping tool. crop the image
What is working:
- go to wp-admin > Media > Library
- you will see there your uploaded image and cropped one with 'cropped' on the beginning of the name
What is not working:
- go again to wp-admin > apperance > customize > site identity
- remove logo image and publish changes
- click logo button to choose image
- you wil not see cropped image in media overlay and search field will not find it (as presented on the screenshot from opening post)
Additional observations:
- both images are in wp_posts table, with same post type, parent and other fields not suggesting something is different between both images.
- So something must be wrong with ajax request for the image. I will investigate with xdebug in a moment
#3
@
5 years ago
- Focuses ui javascript template added
I see ajax request for attachments is processed in wp-admin/includes/ajax-actions.php function \wp_ajax_query_attachments. And this fuction returns both images.
I need to give up here and leave it to someone more fluent in javascript: it looks like js template engine here is unfiltering this image, but I know nothing about this template engine used here.
capture of pop-up of Select or Upload images