When Apache Solr returns a result with an attachment in the results DS fails with:
Warning: reset() expects parameter 1 to be array, boolean given in reset() (line 251 of /ds/modules/ds_search/ds_search.module)
and
Warning: Creating default object from empty value in ds_search_search_page() (line 332 of /ds/modules/ds_search/ds_search.module)

The problem is that attached files are not entities and so entity_view returns false. It looks like there was some plan for support for this but file_view_multiple doesn't exist so it will produce a fatal error if ds_entity_view_fallback ever got that far. It doesn't if you have Entity API installed.

My question is, is there a way to tell display suite to not use the display suite layout and just revert to what Solr returned if ds_entity_view_fallback() returns FALSE?

Files: 
CommentFileSizeAuthor
#4 2003790-4.patch16.7 KBswentel

Comments

Category:bug» task

FWIW, file_view_multiple is available in the Media 1.x module https://drupal.org/project/media (or the File Entity module when using Media 2.x)
Installing those modules doesn't fix the issue, though

Also linked #1950660: DS turning objects into arrays by mistake as well as generating a lot of warnings - I need to clean up the whole solr support there.

Status:Active» Closed (fixed)
StatusFileSize
new16.7 KB

Patch attached has been committed - note that this is against latest 7.x-2.x dev, so use that branch or next dev release for testing.

It adds an extra option on 'admin/structure/ds/list/search' to render files/attachments through the default search result theming function.

In case file_view_multiple() function exists it will use that one, unless you toggle the checkbox to use default search theming as well.