Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2515080-file-entity-view.patch | 845 bytes | Dave Reid |
Comments
Comment #1
Dave Reid@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)?
Comment #2
jenlampton@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.
Comment #3
jenlamptonUpdated to file_entity 7.x-2.x-dev and now everything is hunkey-dorey.
Comment #4
Dave ReidWell we could at least workaround the issue for now.
Comment #5
jenlamptonI totally had this exact same patch ready when you told me it was fixed in -dev ;)
Comment #8
Dave ReidCommitted to 7.x-2.x and 7.x-1.x.