diff --git a/htdocs/sites/default/modules/contrib/term_reference_tree/term_reference_tree.module b/htdocs/sites/default/modules/contrib/term_reference_tree/term_reference_tree.module
index f479a0e..70343fc 100644
--- a/htdocs/sites/default/modules/contrib/term_reference_tree/term_reference_tree.module
+++ b/htdocs/sites/default/modules/contrib/term_reference_tree/term_reference_tree.module
@@ -82,10 +82,17 @@ function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter,

   $result = array();

+  $vocab = taxonomy_vocabulary_load( $vid );
+
   if ($filter != '') {
     foreach($allowed as $k => $v) {
       if (array_key_exists($k, $terms)) {
         $term =& $terms[$k];
+
+        if ( !isset($term->vocabulary_machine_name) && !empty($vocab) ) {
+          $term->vocabulary_machine_name = $vocab->machine_name;
+        }
+
         $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default);
         if (is_array($children)) {
           $term->children = $children;
@@ -102,6 +109,11 @@ function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter,
   else {
     foreach($terms as &$term) {
       if ($filter == '' || array_key_exists($term->tid, $allowed)) {
+
+        if ( !isset($term->vocabulary_machine_name) && !empty($vocab) ) {
+          $term->vocabulary_machine_name = $vocab->machine_name;
+        }
+
         $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default);
         if (is_array($children)) {
           $term->children = $children;
