When I enable file_entity my site crashes.
This is the log message:

EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7633 of .../drupal/includes/common.inc).

I've looked over a couple of past threads in regards to this error but this is the first I've seen on 7.17.
I double checked my db for missing node->types but found none.

Comments

mjbirdge’s picture

When trying to view Gallery pages, I get the same error:
EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7633 in ../includes/common.inc)

Also looked over several past threads with similar errors, but this was the only one I could find with 7.17 & Media 7.x-2.x / 7.x-2.0-unstable.

Looking through the file_managed table, all lines have the 'type' and 'filemime' fields populated.
e.g.
SELECT fid,filemime,type from drupal_file_managed;

+-----+------------+-------+
| fid | filemime   | type  |
+-----+------------+-------+
| 508 | image/jpeg | image |
+-----+------------+-------+

Looking at this issue #1268006: Get error when upgrading from 7.7 to 7.8 EntityMalformedException:Missing bundle property on entity of type file. in entity_extr led me to try to edit common.inc to get more debugging info. Here's a portion of the results from using print_r() to print the entity in question:

if (!isset($entity->{$info['entity keys']['bundle']})) {
        die(print_r($entity,TRUE));
stdClass Object ( [fid] => 1171 [title] => [data] => [file] => stdClass Object ( [fid] => 1171 [uid] => 1 [filename] => 20121216-1688_0.jpg [uri] => public://media/20121216-1688_0.jpg [filemime] => image/jpeg [filesize] => 1680238 [status] => 1 [timestamp] => 1355807363 [type] => image [field_file_image_alt_text] => Array ( ) [field_file_image_title_text] => Array ( ) [media_description] => Array ( ) [media_title] => Array ( [und] => Array ( [0] => Array ( [value] => 20121216 [format] => [safe_value] => 20121216 ) ) ) [field_tags] => Array ( [und] => Array ( [0] => Array ( [tid] => 463 ) [1] => Array ( [tid] => 419 ) [2] => Array ( [tid] => 62 ) [3] => Array ( [tid] => 334 ) [4] => Array ( [tid] => 460 ) [5] => Array ( [tid] => 309 ) [6] => Array ( [tid] => 464 ) ) ) [field_license] => Array ( [und] => Array ( [0] => Array ( [value] => none ) ) ) [field_folder] => Array ( [und] => Array ( [0] => Array ( [tid] => 462 ) ) ) [rdf_mapping] => Array ( ) [image_dimensions] => Array ( [width] => 2880 [height] => 1727 ) ) )

So it looks as though there is data for the file type showing: [type] => image.
This looks like it is at very least populated, but I did read elsewhere that changing this to 'jpeg' might be part of the solution. I haven't tried mucking with my DB yet to confirm.

I'm not sure where to go from here yet, but wanted to share this in case it helps someone else.

dave reid’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

What are you using to display the Gallery pages? It looks like something is trying to pass in a file field value as a file entity somehow. Can you do a backtrace() where this error happens to help trace where it's being passed from?

dave reid’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing due to lack of information.