• Resolved tajroyer

    (@tajroyer)


    Hi I have a client that is using web sotries 1.28.1. When they are in the editor and try to search for an image from their media library it always says results not found. Even when searching using the exact name of the image it doesn’t show any results. Any idea what could be causing this?

Viewing 11 replies - 1 through 11 (of 11 total)
  • @tajroyer Hello there! Happy to help here. I am not seeing the same issue on my test site when searching for image file name in the media library, so it sounds like one of their plugins could be conflicting with Web Stories.

    1. Could you please test to see if you get the same issue when Web Stories is the only plugin activated on the site and when using a default theme?
    2. We can try to evaluate things on our end if you could provide your Site Health information privately here.
    Thread Starter tajroyer

    (@tajroyer)

    Hi @luckynasan Thanks for getting back to me.

    I’ve tried it with all the plugins disabled and it still doesn’t seem to be working. I’ve provided all the information about the site in google form. Let me know if you need anything else?

    @tajroyer Just a quick update that I’ve been trying to do further testing on my end but haven’t been able to reproduce this issue yet. Curious, does the same issue occur on version 1.29.0 of the Web Stories plugin? What is the image file URL and what is the search term you are using?

    Thread Starter tajroyer

    (@tajroyer)

    Hi @luckynasan Thanks for getting back to me. I’ve updated the plugin to 1.29 and the search still isn’t working. I’ve been searching using the term “apple” to find this file : cropped-Apple-Cinnamon-French-Toast3.jpg

    But any search term I use doesn’t seem to be working.

    @tajroyer Thank you for the update. I am still not able to reproduce this so far. Could you confirm the image exists in the WordPress media and you can see it in the Web Stories media panel also? It would be helpful if you could please share a screen recording of your experience using a service such as Loom or Recordit then share the URL here?

    @tajroyer When performing a media search in the editor, what the browser essentially does is calling https://healthyfamilyproject.com/wp-json/wp/v2/media?search=apple

    This is WordPress’ built-in REST API for media items. For some reason, searching for that media item is not working on your site. It’s possible the  media search is disabled somewhere in the code, or there is some security measures implemented. Reach out to your hosting provider regarding this issue with the REST API and to check if there is something off with your site setup.

    Thread Starter tajroyer

    (@tajroyer)

    Hi @luckynasan so I checked to see what the request URL was when I searched for “apple” and here is what I see:

    /wp-json/web-stories/v1/media/?context=view&per_page=50&page=1&_web_stories_envelope=true&_fields=id%2Cdate_gmt%2Cmedia_details%2Cmime_type%2Cfeatured_media%2Cfeatured_media_src%2Calt_text%2Csource_url%2Cmeta%2Cweb_stories_media_source%2Cweb_stories_is_muted%2Cbody%2Cstatus%2Cheaders&search=apple&_locale=user

    Any idea why it may be different? Thanks.

    • This reply was modified 3 years, 4 months ago by tajroyer.
    Plugin Author Pascal Birchler

    (@swissspidy)

    It’s different because in the editor we have a custom route /wp-json/web-stories/v1/media/ that is essentially a wrapper around wp-json/wp/v2/media. That doesn’t really matter here though.

    Once you find and eliminate the reason why media search via wp-json/wp/v2/media?search=apple is not working on your site, it will also help with the story editor.

    Thread Starter tajroyer

    (@tajroyer)

    Hi @swissspidy Thanks for jumping in as well.

    We confirmed that Cloudflare’s firewall is not blocking the request, so the 403 response isn’t coming from there. We then contacted the host, and they said this:

    As far as we can tell, the API endpoint is simply returning a empty result. It is not a issue with anything server side.

    It is either a issue with the WordPress API itself or something about Web Stories’ wrapper around it.

    Any other ideas of what could be casusing this?

    Plugin Author Pascal Birchler

    (@swissspidy)

    so the 403 response isn’t coming from there

    You haven’t mentioned 403 before, where are you seeing this response code?

    I’m still pretty sure the endpoint is returning an empty result because something has disabled the media search functionality. You will notice that whatever search term you use (e.g. https://healthyfamilyproject.com/wp-json/wp/v2/media?search=<searchterm>), there are never any results. Yet, when you do the same search in the WordPress admin in the media library, you will see some results. For exmple, with the search term “apple”, your apple cinnamon french toast image should show up. Yet, the REST API search results are empty.

    @tajroyer We are going to mark your topic as resolved as we haven’t received a response. Please feel free to open a new support topic if you experience any other issues. Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘image search not working’ is closed to new replies.