d9aae6717647d53e279fd7bd36c6568acb67b8c9
tdreszer
  Fri Nov 5 12:17:30 2010 -0700
Fixed bug where cell was not showing up in whitelist to track search
diff --git src/hg/lib/mdb.c src/hg/lib/mdb.c
index 713b01e..1564f1d 100644
--- src/hg/lib/mdb.c
+++ src/hg/lib/mdb.c
@@ -2148,31 +2148,34 @@
 }
 
 struct hash *mdbCvTermTypeHash()
 // returns a hash of hashes of mdb and controlled vocabulary (cv) term types
 // Those terms should contain label,descrition,searchable,cvDefined,hidden
 {
 static struct hash *cvHashOfTermTypes = NULL;
 
 // Establish cv hash of Term Types if it doesn't already exist
 if (cvHashOfTermTypes == NULL)
     {
     cvHashOfTermTypes = raReadWithFilter(cv_file(), "term","type","typeOfTerm");
     // Patch up an ugly inconsistency with 'cell'
     struct hash *cellHash = hashRemove(cvHashOfTermTypes,"cellType");
     if (cellHash)
+        {
         hashAdd(cvHashOfTermTypes,"cell",cellHash);
+        hashReplace(cellHash, "term", cloneString("cell")); // spilling memory of 'cellType' val
+        }
     }
 
 
 return cvHashOfTermTypes;
 }
 
 struct slPair *mdbCvWhiteList(boolean searchTracks, boolean cvDefined)
 // returns the official mdb/controlled vocabulary terms that have been whitelisted for certain uses.
 {
 struct slPair *whitePairs = NULL;
 
 // Get the list of term types from thew cv
 struct hash *termTypeHash = mdbCvTermTypeHash();
 struct hashCookie hc = hashFirst(termTypeHash);
 struct hashEl *hEl;
@@ -2186,27 +2189,26 @@
         if(SETTING_IS_ON(setting))
             continue;
         }
     if (searchTracks)
         {
         setting = hashFindVal(typeHash,"searchable");
         if (setting == NULL || differentWord(setting,"select")) // TODO: Currently only 'select's are supported
             continue;
         }
     if (cvDefined)
         {
         setting = hashFindVal(typeHash,"cvDefined");
         if(SETTING_NOT_ON(setting))
             continue;
         }
-    char *term = hashMustFindVal(typeHash,"term");
+    char *term  = hEl->name;
     char *label = hashFindVal(typeHash,"label");
     if (label == NULL)
         label = term;
-
     slPairAdd(&whitePairs, term, cloneString(label)); // Term gets cloned in slPairAdd
     }
 if (whitePairs != NULL)
     slPairValSortCase(&whitePairs);
 
 return whitePairs;
 }