With the latest upgrade of Drupal (and possibly the entity module), I'm getting an error when the menu items are synced using the batch:

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids

This is because the loaded terms do not have a 'vocabulary_machine_name' (bundle) property. This can be fixed by adding some parameters to the call to `taxonomy_get_tree` in the function `_taxonomy_menu_insert_link_items_batch`:

function _taxonomy_menu_insert_link_items_batch($vid) {
  $terms = taxonomy_get_tree($vid, 0, NULL, TRUE);
  $menu_name = variable_get(_taxonomy_menu_build_variable('vocab_menu', $vid), FALSE);
// ...

The last 'TRUE' is the key; this makes sure the terms are fully loaded.

CommentFileSizeAuthor
#1 2174889-1-pass-correct-args.patch435 bytesdstol

Comments

dstol’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new435 bytes

Let's see what testbot says here.

dstol’s picture

Status: Needs review » Fixed

Thanks for the report. Committed to 7.x-1.x

Status: Fixed » Closed (fixed)

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

docans’s picture

I am having this same error: " Missing bundle property on entity of type taxonomy_term. " i am on commerce kickstart which primary uses the taxonomy menu.

I got this error when i tried importing taxonomy term with feeds. using data from views data export module.