I'm attempting to use entity_embed for inline image handling, but rendering files seems to throw PHP notices instead of rendering the file entity.

    Notice: Undefined index: file in entity_embed_render_embed() (line 593 of docroot/sites/all/modules/contrib/entity_embed/entity_embed.module).
    Notice: Undefined index: file in entity_embed_render_embed() (line 593 of docroot/sites/all/modules/contrib/entity_embed/entity_embed.module).
    Notice: Undefined index: file in entity_embed_render_embed() (line 593 of docroot/sites/all/modules/contrib/entity_embed/entity_embed.module).
    Notice: Undefined index: file in entity_embed_render_embed() (line 593 of docroot/sites/all/modules/contrib/entity_embed/entity_embed.module).

There's a code comment before line 593:

// The output of entity_view() is keyed by the entity type and ID.

Only, It looks like the renderable array for file entities uses the key 'files' instead of the expected entity type 'file'.

CommentFileSizeAuthor
#4 2515080-file-entity-view.patch845 bytesDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

@jenlampton /me waves. Are you using a version of File Entity older than when http://cgit.drupalcode.org/file_entity/commit/?id=afad95488638910bf8e8e6... was committed (Oct 29, 2014)?

jenlampton’s picture

@DaveReid /me waves back
I'm using the latest stable (or whatever drush dl gets me) so, 7.x-2.0-beta1 circa 2014-Oct-04, yes.

jenlampton’s picture

Category: Task » Support request
Status: Active » Fixed

Updated to file_entity 7.x-2.x-dev and now everything is hunkey-dorey.

Dave Reid’s picture

Status: Fixed » Needs review
FileSize
845 bytes

Well we could at least workaround the issue for now.

jenlampton’s picture

Status: Needs review » Reviewed & tested by the community

I totally had this exact same patch ready when you told me it was fixed in -dev ;)

  • Dave Reid committed 1fc2164 on 7.x-2.x
    Issue #2515080 by Dave Reid, jenlampton: Fixed embedding files if...

  • Dave Reid committed f0f5f1a on
    Issue #2515080 by Dave Reid, jenlampton: Fixed embedding files if...
Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-2.x and 7.x-1.x.

Status: Fixed » Closed (fixed)

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