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

#4 2003790-4.patch16.7 KBswentel
Members fund testing for the Drupal project. Drupal Association Learn more


swentel’s picture

Category: bug » task
bart.hanssens’s picture

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

swentel’s picture

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.

swentel’s picture

Status: Active » Closed (fixed)
16.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.