Commit f0f5f1a9 authored by Dave Reid's avatar Dave Reid Committed by Dave Reid

Issue #2515080 by Dave Reid, jenlampton: Fixed embedding files if file_entity...

Issue #2515080 by Dave Reid, jenlampton: Fixed embedding files if file_entity does not yet include the fix from #2365821.
parent 5f1cae10
......@@ -588,6 +588,12 @@ function entity_embed_render_embed($entity, $context) {
// rendering.
$renderable_array = entity_view($context['data-entity-type'], array($entity), $context['data-entity-embed-settings']['view_mode'], $context['data-langcode']);
// Workaround for file_entity module that does not have the patch in
// https://www.drupal.org/node/2365821 applied yet.
if ($context['data-entity-type'] === 'file' && isset($renderable_array['files'])) {
$renderable_array = array('file' => reset($renderable_array));
}
// The output of entity_view() is keyed by the entity type and ID.
$build = $renderable_array[$context['data-entity-type']][$context['data-entity-id']];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment