Notice: Undefined index: {FID} in mediafield_field_prepare_view() (line 169 of sites/all/modules/media/modules/mediafield/mediafield.module).
Notice: Undefined index: file in mediafield_field_formatter_view() (line 137 of sites/all/modules/media/modules/mediafield/mediafield.module).
EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7409 of includes/common.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Needs review
FileSize
992 bytes
David_Rothstein’s picture

Priority: Normal » Major
FileSize
1000 bytes

I ran into this issue as well, in Media 7.x-1.x. For reference, I'm attaching a version of the patch that applies there. It seems to work.

These patches do seem to be working around the problem rather than fixing the root cause, though. However, I guess the root cause might live outside the Media module (basically, if any module out there deletes files without checking that they're not in use first, you can get into this situation, so perhaps it makes sense for Media to protect against it)? I haven't yet been able to track down how it happened in my case.

I'm also upping the priority to major (at least), since this leads to fatal errors when it occurs...

David_Rothstein’s picture

Dave Reid’s picture

Assigned: Unassigned » Dave Reid
Status: Needs review » Fixed

Committed a mix of this with some other cleanups to mediafield_field_prepare_view() and mediafield_field_is_empty() to both 7.x-2.x and backported to 7.x-1.x.
http://drupalcode.org/project/media.git/commit/d87c2f1
http://drupalcode.org/project/media.git/commit/7e8f33b

jjclint’s picture

I've just upgraded to the latest dev version that contains the comits in #4 and I get the following error message multiple times instead of seeing the images on the page and the embedded youtube links:

Notice: Undefined index: module in _field_info_prepare_instance_display() (line 354 of

tsvenson’s picture

@jjclint Have you tried clearing the cache? Some of the latest patches that has been committed have produced errors like the one you describe, but clearing the cache made them go away.

jjclint’s picture

Yes I've tried that but it doesn't help.

Also after I clear the cache and run the update script again from mysite.com/update.php the update fails and I get the following multiple error messages:

Notice: Undefined index: module in _field_info_prepare_instance_display() (line 354 of /sitepath/public_html/modules/field/field.info.inc).

Status: Fixed » Closed (fixed)

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