Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2020 at 09:50 UTC
Updated:
1 Oct 2020 at 09:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
maximpodorov commentedComment #3
maximpodorov commentedComment #4
ankithashettyHave been facing this issue for the image field in the search view. The solution provided in #2 worked for me...
Comment #5
ankithashettyPatch in #2 applied successfully. Changing status to RTBC.

Comment #6
ressaIt would be great with the minimal steps required to reproduce the error, like "create a field of type XYZ, create a view using this field, etc.".
Comment #7
ankithashettyYeah sure @ressa, I'll list out the steps that I followed to encounter this error:
1. First, make sure you have created a search Index(/admin/config/search/search-api), with Datasource as "Content Type" and select the fields you would like to display on the search page.
2. In the Serach view, place the fields to be rendered on the search page.
3. Click on the Image field and choose the following configuration settings.
3 a. Uncheck the option "Use entity field rendering".
3 b. Under "Render settings", select "Entity View" option to Display Image bundle. Save the view.
4. Visit the search page (/search), you get the following error: (without the patch)
5. After applying the patch, refresh the search page, all fields are rendered properly. (with patch from #2)
Hope this helps! Thanks.
Comment #8
ressaThanks @ankithashetty! I followed your steps, initially using the "Article" "Image" field for testing:
/admin/structure/types/manage/article/fields/node.article.field_image, but didn't see "Display for "Image" bundle" > "Entity View" (image 3 b.) under "Render settings" in the View ...I tried enabling the Media module, and created an Image there, and now I seemed to get closer, getting a "Display for "Image" bundle" > "Entity View" in my View, which I could select, though there was no "View mode" > "Thumbnail" option ...
Perhaps this is mostly an issue with images from the Media module, or is it just that the default Article Image doesn't have a view mode defined?
Anyway, I now got the error in my searches, and preview in the View didn't work. After I applied the patch, the image showed in the results, not using "Use entity field rendering", but "Render settings" > "Display for "Image" bundle" in stead, and preview in my View worked, so the patch seems to do the job.
Comment #9
ankithashettyHey @ressa! Thanks for trying it out. And regarding the "View mode" > "Thumbnail" option you guessed it right, it's just a custom view mode I had created for Image Media type, so need not worry about that. Sorry for creating confusion there.
Comment #10
ressaThanks for clarifying, I guess all we can do now is wait for this issue to go to the next stages.
Comment #11
drunken monkeyThanks a lot for reporting this issue and providing a patch, maximpodorov, and thanks a lot to ankithashetty and ressa for explaining and reviewing so thoroughly!
This is very obviously a bug and the fix is very simple. I’m a bit bummed that we didn’t have test coverage for this, but I guess this specific problem is unlikely to resurface, and setting up the Media module for a Views test seems a bit overkill. So, happy to commit just the fix in this case.
Committed. Thanks a lot again, everyone!
Comment #13
ressaGreat, and thanks for maintaining the Search API module drunken monkey. Also thanks to ankithashetty and maximpodorov for patching and testing :-)