From 7b35561d121e3fb70870fc2ccf023132cf4619fe Mon Sep 17 00:00:00 2001
From: Canini <canini.16@tso-nc201335.asc.ohio-state.edu>
Date: Tue, 28 May 2019 14:17:42 -0400
Subject: [PATCH] Set taxonomy term filter labels to the taxonomy name for new
 people 3 taxonomy

---
 web/themes/asc_bootstrap/asc_bootstrap.theme | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/web/themes/asc_bootstrap/asc_bootstrap.theme b/web/themes/asc_bootstrap/asc_bootstrap.theme
index d20962fd77..dee8ebcc9b 100755
--- a/web/themes/asc_bootstrap/asc_bootstrap.theme
+++ b/web/themes/asc_bootstrap/asc_bootstrap.theme
@@ -157,6 +157,24 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
         }
       }
     }
+
+
+    if(count($form['field_other_target_id']['#options']) == 0) {
+      $form['field_other_target_id']['#access'] = FALSE;
+    }
+    else {
+      $tid = array_shift(array_keys($form['field_other_target_id']['#options']));
+      $term = Term::load($tid);
+      if (!empty($term)) {
+        $vid = array_shift($term->vid->getValue())['target_id'];
+        if(!empty($vid)) {
+          $vocab = Vocabulary::load($vid);
+          $vocab_label = $vocab->get('name');
+          $form['#info']['filter-field_other_target_id']['label'] = $vocab_label;
+        }
+      }
+    }
+
   }
 
   /*
@@ -182,4 +200,4 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
     $form['field_appointment_target_id']['#weight'] = 3;
     $form['field_research_interests_target_id']['#weight'] = 4;
   }
-}
\ No newline at end of file
+}
-- 
GitLab