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.

Comments

gnucifer’s picture

StatusFileSize
new4.05 KB
gnucifer’s picture

Issue summary: View changes
gifad’s picture

Status: Active » Needs review
nagy.balint’s picture

Status: Needs review » Closed (duplicate)

This 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.

gnucifer’s picture

Status: Closed (duplicate) » Needs review

This 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.

nagy.balint’s picture

Okey, will check in a few days.

nagy.balint’s picture

StatusFileSize
new3.47 KB

Created 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.

nagy.balint’s picture

Title: Entity views not working » compatibility with EVA
nagy.balint’s picture

Status: Needs review » Fixed

Thanks, committed.

  • nagy.balint committed ac951c6 on 7.x-1.x
    Issue #2396179 by gnucifer, nagy.balint: compatibility with EVA
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.