=== modified file 'modules/taxonomy_defaults/taxonomy_defaults.module' --- modules/taxonomy_defaults/taxonomy_defaults.module 2009-01-13 13:27:08 +0000 +++ modules/taxonomy_defaults/taxonomy_defaults.module 2009-05-19 15:53:20 +0000 @@ -88,7 +88,21 @@ // Active vocabs have been inserted via the form already and may have been modified by the user if (!$activevocab && variable_get("taxdef_{$node->type}_{$vid}_active", FALSE)) { $default_tids = variable_get("taxdef_{$node->type}_{$vid}", array()); - $taxonomy[$vid] = $vocab->multiple ? $default_tids : $default_tids[0]; + // check mode. If taxonomy property contains array of objects use different processing + if (is_object(current($taxonomy))) { // now decide if we should process + $default_tids = $vocab->multiple ? $default_tids : array($default_tids[0]); + foreach ($default_tids as $tid) { + if (empty($taxonomy[$tid])) { + $object = new stdClass(); + $object->vid = $vocab->vid; + $object->tid = $tid; + $taxonomy[$tid] = $object; + } + } + } + else { + $taxonomy[$vid] = $vocab->multiple ? $default_tids : $default_tids[0]; + } } } if (isset($taxonomy)) {