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.
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).
Comment | File | Size | Author |
---|---|---|---|
#2 | media-entity-malformed-exception-1426820-2-7.x-1.x-D7.patch | 1000 bytes | David_Rothstein |
#1 | media-mediafield-1426820-1-fix-fatial-on-missing-fid.patch | 992 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedComment #2
David_Rothstein CreditAttribution: David_Rothstein commentedI 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...
Comment #3
David_Rothstein CreditAttribution: David_Rothstein commentedI also posted #1433558: EntityMalformedException when media gallery files no longer exist in the {file_managed} table with a similar patch for the Media Gallery module.
Comment #4
Dave ReidCommitted 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
Comment #5
jjclint CreditAttribution: jjclint commentedI'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
Comment #6
tsvenson CreditAttribution: tsvenson commented@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.
Comment #7
jjclint CreditAttribution: jjclint commentedYes 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).