5ed8f560efb5af18673ae76180e24ec493698cb2
galt
  Thu Nov 20 17:07:25 2025 -0800
Fixes pdf output problem. We set hgFindMatches = NULL for pdf output to suppress the item search highlight. But loading in bigBedTrack and squishPackyMode both depend on that search term, so we cannot just set it to NULL. A copy of it called origHgFindMatches exists and is available to those routines that need the original search value.

diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c
index eb89704d949..7fffa28905b 100644
--- src/hg/hgTracks/bigBedTrack.c
+++ src/hg/hgTracks/bigBedTrack.c
@@ -347,32 +347,32 @@
 for (;filterBy != NULL; filterBy = filterBy->next)
     {
     if (filterBy->slChoices && differentString(filterBy->slChoices->name, "All"))
         {
         if ((highlight = bigBedMakeFilterBy(cart, bbi, tdb, filterBy->column, filterBy->slChoices, TRUE)) != NULL)
             slAddHead(&highlights, highlight);
         }
     }
 
 return highlights;
 }
 
 boolean bigBedFilterOne(struct bigBedFilter *filter, char **bedRow, struct bbiFile *bbi)
 /* Return TRUE if a bedRow passes one filter or is in hgFindMatches */
 {
-if ((bbi->definedFieldCount > 3) && (hgFindMatches != NULL) && 
-    (bedRow[3] != NULL)  && hashLookup(hgFindMatches, bedRow[3]) != NULL)
+if ((bbi->definedFieldCount > 3) && (origHgFindMatches != NULL) && 
+    (bedRow[3] != NULL)  && hashLookup(origHgFindMatches, bedRow[3]) != NULL)
     return TRUE;
 
 double val = atof(bedRow[filter->fieldNum]);
 
 switch(filter->comparisonType)
     {
     case COMPARE_WILDCARD:
         if ( !wildMatch(filter->wildCardString, bedRow[filter->fieldNum]))
             return FALSE;
         break;
     case COMPARE_REGEXP:
         if (regexec(&filter->regEx,bedRow[filter->fieldNum], 0, NULL,0 ) != 0)
             return FALSE;
         break;
     case COMPARE_HASH_LIST_AND:
@@ -415,32 +415,32 @@
         if (!(val >= filter->value1))
             return FALSE;
         break;
     case COMPARE_BETWEEN:
         if (!((val >= filter->value1) && (val <= filter->value2)))
             return FALSE;
         break;
     }
 return TRUE;
 }
 
 
 boolean bigBedFilterInterval(struct bbiFile *bbi, char **bedRow, struct bigBedFilter *filters)
 /* Go through a row and filter based on filters.  Return TRUE if all filters are passed. */
 {
-if ((bbi->definedFieldCount > 3) && (hgFindMatches != NULL) && 
-    (bedRow[3] != NULL)  && hashLookup(hgFindMatches, bedRow[3]) != NULL)
+if ((bbi->definedFieldCount > 3) && (origHgFindMatches != NULL) && 
+    (bedRow[3] != NULL)  && hashLookup(origHgFindMatches, bedRow[3]) != NULL)
     return TRUE;
 
 struct bigBedFilter *filter;
 for(filter = filters; filter; filter = filter->next)
     if (!bigBedFilterOne(filter, bedRow, bbi))
         return FALSE;
 return TRUE;
 }
 
 
 struct bbiFile *fetchBbiForTrack(struct track *track)
 /* Fetch bbiFile from track, opening it if it is not already open. */
 {
 struct bbiFile *bbi = track->bbiFile;
 if (bbi == NULL)