I am getting this error:

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7562 of /includes/common.inc).

I'm stuck debugging this. All I have is:

  • The nodes this is about have several taxonomy terms.
  • At the spot where the exception is thrown, some taxonomy fields only contain one element: the tid. Others contain more elements including the object "taxonomy_term".
  • The reason why the exception is thrown is, that in taxonomy.module::taxonomy_field_formatter_view() the $term passed to entity_uri() (and then to entity_extract_ids() is $term = $item['taxonomy_term'];, which for some fields does not exisit (as mentioned above).
  • Maybe it's helpful to know that I'm coming from d6 with this site.

I'd be really grateful for every hint. I can't find why some taxonomy fields are not populated.

#3 1736466.taxonomy_term_bundle_name.patch466 bytesrszrama
FAILED: [[SimpleTest]]: [MySQL] 40,238 pass(es), 0 fail(s), and 24 exception(s).
[ View ]


rmfleet’s picture

I have received this same error code on the same line while displaying a specific content type in a view as a blog roll.

I changed the pager output from 'full' to 'mini' and the error disappeared. If pager items per page is larger than the number of nodes to be displayed, the error does not occur when using the full pager. I am using 7.16.

rszrama’s picture

Title:Missing bundle property on entity of type taxonomy_term» taxonomy_entity_info() uses the wrong 'bundle_keys' bundle name for taxonomy_term
Version:7.15» 7.x-dev
Category:support» bug
Status:Active» Needs review
new466 bytes
FAILED: [[SimpleTest]]: [MySQL] 40,238 pass(es), 0 fail(s), and 24 exception(s).
[ View ]

I believe this is a result of a bug I discovered in the entity info for taxonomy terms. The entity keys array uses the correct bundle key name for taxonomy terms (vocabulary_machine_name), but the bundle keys array that's used by a couple API functions like this uses a wrong name (machine_name). Attached patch updates these to match and fixes my issue - and I'm guessing yours.

Status:Needs review» Needs work

The last submitted patch, 1736466.taxonomy_term_bundle_name.patch, failed testing.

wgsimon’s picture

I had a similar problem when calling field_extract_bundle() on a taxonomy_term entity type. The patch seems to have solved the problem.

wgsimon’s picture

Just noticed that this breaks the call to field_extract_bundle( ) in field_ui_field_overview_form( ) in field_ui.admin.inc.

wodenx’s picture

I can confirm that the patch in #3 is definitely incorrect. See #2024813: hook_entity_info_alter on taxonomy_term "bundle keys" breaks "Manage Fields"