Index: taxonomy.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/diff/Attic/taxonomy.inc,v retrieving revision 1.3 diff -u -F^f -r1.3 taxonomy.inc --- taxonomy.inc 5 Mar 2008 21:03:17 -0000 1.3 +++ taxonomy.inc 21 Mar 2008 23:22:44 -0000 @@ -9,17 +9,23 @@ function taxonomy_diff(&$old_node, &$new // TODO: make taxonomy by category not only by whole taxonomy? $old_taxonomy = array(); $new_taxonomy = array(); - if($old_node->taxonomy) { + if ($old_node->taxonomy) { foreach($old_node->taxonomy as $term) { $old_taxonomy[] = $term->name; } } if ($new_node->taxonomy) { foreach($new_node->taxonomy as $id => $entry) { - if (is_array($entry)) { - // During editing the taxonomy is built up as a list of vocabulary ids as keys - // and a list of term ids per array entry. + if (is_object($entry)) { + // When diffing revisions, taxonomy is an array of term objects. + $new_taxonomy[] = $entry->name; + } + else if (is_array($entry)) { + // During editing, taxonomy will be an array for multi-select and + // freetagging vocabularies. if (is_numeric($id)) { + // A multi-select taxonomy is built up as a list of vocabulary ids as keys and + // a list of term ids per array entry. foreach($entry as $tid) { $term = taxonomy_get_term($tid); $new_taxonomy[] = $term->name; @@ -39,8 +45,10 @@ function taxonomy_diff(&$old_node, &$new } } else { - // Not during editing the taxonomy list is a list of terms. - $new_taxonomy[] = $entry->name; + // During editing, a single-select taxonomy is built up as a list of vocabulary ids as keys + // with term ids per array entry. + $term = taxonomy_get_term($entry); + $new_taxonomy[] = $term->name; } } }