Entity view function "scald_render_multiple" should return array keyed by entity type, and then another nested array keyed by entity id.

return array(
  'scald_atom' => array(
    12 => array(/*...render array for scald_atom with sid 12...*/),
    13 => array(/*...render array for scald_atom with sid 13...*/),
    14 => array(/*...render array for scald_atom with sid 14...*/),
  ),
);

I know that EntityAPIControllerInterface::view() is not telling you this, but have a look at EntityAPIController::view() of DrupalCommerceEntityController::view().

Scenario of one of possible bugs:
1. Create view for scald atoms.
2. Choose "Rendered entity" as format to show
3. Choose any format you like
4. See no results shown

See entity_views_plugin_row_entity_view::pre_render() and entity_views_plugin_row_entity_view::render() for more details about views integration bug.

CommentFileSizeAuthor
#2 scald_render_multiple-2424189.patch561 bytesa.milkovsky
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a.milkovsky’s picture

Issue summary: View changes
a.milkovsky’s picture

Assigned: a.milkovsky » Unassigned
Status: Active » Needs review
FileSize
561 bytes

Created the patch.
Please also mind https://www.drupal.org/node/2089865 issue that affects scald_render_multiple as well.

a.milkovsky’s picture

Issue summary: View changes
a.milkovsky’s picture

Issue summary: View changes
gifad’s picture

Hi,

What do you think of the approach at https://www.drupal.org/node/2396179 (patch #1) ?
This is the only one to make devel render ( /atom/###/devel/render ) working...
Don't know if that is significant (or even related) ...

a.milkovsky’s picture

HI, gifad. I also had issue with Search API view.
Unfortunately I haven't found the issue you mentioned. I only searched issues about scald_render_multiple.
The solution you mentioned affects view_modes as well. But I am not sure if it is necessary to change view modes logic just for making entity views working.

fago’s picture

Status: Needs review » Reviewed & tested by the community

Yep, that's the right format used by core and afaik only documented by entity_view() in entity module. I'd suggest following that also for improved interoperability :-)

fago’s picture

Forgot to mention: Yes the patch looks good and solves the issue!

jcisio’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed. Thanks!

  • jcisio committed 736a63e on 7.x-1.x authored by a.milkovsky
    Issue #2424189 by a.milkovsky: Make scald_render_multiple compatible...

Status: Fixed » Closed (fixed)

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