In scald_entity_info the function defined in "view callback" currently returns scald entities keyed by base id. The format of this function is (by entity api etc expected to be $build[$entity_type][$entity_id]). Here is a patch to fix that. I found this issue trying to use scald in conjunction with Search API and Search API views. Scald atoms must be rendered as entities in this context, and without this change this will fail.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | build-content-adjustments-2396179-7.patch | 3.47 KB | nagy.balint |
| #1 | scald-entity-view-callback-2396179-1.patch | 4.05 KB | gnucifer |
Comments
Comment #1
gnucifer commentedComment #2
gnucifer commentedComment #3
gifad commentedComment #4
nagy.balint commentedThis was solved in the following issue: #2424189: Make scald_render_multiple compatible with Entity API
Even though this issue was before that issue, it has now become a duplicate then.
Comment #5
gnucifer commentedThis patch also adds the following properties to content:
'#entity_type' => 'scald_atom',
'#entity' => $atom,
'#language' => $langcode,
Which are need for compatiblity with EVA for example. So this needs some consideration in my opinion.
Comment #6
nagy.balint commentedOkey, will check in a few days.
Comment #7
nagy.balint commentedCreated the attached patch.
I think its indeed a good idea to use the https://api.drupal.org/api/drupal/includes!common.inc/function/entity_vi... function introduced in 7.33
Also the #atom was introduced in the display suite patch, but it will work just fine with #entity as well (after changing the preprocess). Then hopefully its also compatible with other modules.
#view_mode and #language is already produced by the build function, so not needed to add in the view function.
@jussil , @gnucifer Can you test if this patch will do? And also if the display suite still works fine.
In my tests it seems to be fine, but its better to double check.
Comment #8
nagy.balint commentedComment #9
nagy.balint commentedThanks, committed.