From 6e759cbc0d92ca191a4864572c3ac3e3cdbaf174 Thu, 5 May 2011 12:52:06 -0500
From: Jess <Jess@Jess-PC.art-sci.wustl.edu>
Date: Thu, 5 May 2011 12:51:27 -0500
Subject: [PATCH] #1101432Fix

diff --git a/plugins/access/term.inc b/plugins/access/term.inc
index 043f421..36e70de 100644
--- a/plugins/access/term.inc
+++ b/plugins/access/term.inc
@@ -65,22 +65,13 @@
       '#multiple' => TRUE,
     );
 
-    // If it's a tag, use an autocomplete.
-    if ($vocabulary->tags) {
-      $form['settings'][$vocabulary->vid]['#type'] = 'textfield';
-      $form['settings'][$vocabulary->vid]['#autocomplete_path'] = 'taxonomy/autocomplete/' . $vocabulary->vid;
+    $terms = array();
+    foreach (taxonomy_get_tree($vocabulary->vid) as $tid => $term) {
+      $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name;
     }
-
-    // Other vocabs just show a list.
-    else {
-      $terms = array();
-      foreach (taxonomy_get_tree($vid) as $x => $term) {
-        $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name;
-      }
-      $form['settings'][$vocabulary->vid]['#type'] = 'select';
-      $form['settings'][$vocabulary->vid]['#options'] = $terms;
-      unset($terms);
-    }
+    $form['settings'][$vocabulary->vid]['#type'] = 'select';
+    $form['settings'][$vocabulary->vid]['#options'] = $terms;
+    unset($terms);
   }
   $form['settings']['vid']['#options'] = $options;
   return $form;
@@ -108,22 +99,14 @@
   }
 
   $return = FALSE;
-  // Tags get saved as an imploded array of strings.
-  if (!is_array($conf[$vid])) {
-    $terms = explode(', ', $conf[$vid]);
-    // For multi-term with names, we'll only accept the first term because
-    // that is the name we have.
-    return in_array($context->data->name, $terms);
+
+  $terms = array_filter($conf[$vid]);
+  // For multi-term if any terms coincide, let's call that good enough:
+  if (isset($context->tids)) {
+    return (bool) array_intersect($terms, $context->tids);
   }
   else {
-    $terms = array_filter($conf[$vid]);
-    // For multi-term if any terms coincide, let's call that good enough:
-    if (isset($context->tids)) {
-      return (bool) array_intersect($terms, $context->tids);
-    }
-    else {
-      return in_array($context->data->tid, $terms);
-    }
+    return in_array($context->data->tid, $terms);
   }
 }
 
@@ -131,16 +114,11 @@
  * Provide a summary description based upon the checked terms.
  */
 function ctools_term_ctools_access_summary($conf, $context) {
-  $vocab = taxonomy_vocabulary_load($conf['vid']);
-  if ($vocab->tags) {
-    $terms = explode(', ', $conf[$vocab->vid]);
-  }
-  else {
-    $terms = array();
-    foreach ($conf[$vocab->vid] as $tid) {
-      $term = taxonomy_term_load($tid);
-      $terms[] = $term->name;
-    }
+  $vid = $conf['vid'];
+  $terms = array();
+  foreach ($conf[$vid] as $tid) {
+    $term = taxonomy_term_load($tid);
+    $terms[] = $term->name;
   }
 
   return format_plural(count($terms),
