ce206137add4e9417334363faeef58be09363972
chmalee
  Tue Jul 6 11:12:13 2021 -0700
Native track 'url' settings should not get early expanded, refs #27752 and #27767

diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c
index b7bfd9b..c3c3b7f 100644
--- src/hg/lib/trackDbCustom.c
+++ src/hg/lib/trackDbCustom.c
@@ -11,30 +11,31 @@
 #include "jksql.h"
 #include "trackDb.h"
 #include "hdb.h"
 #include "hui.h"
 #include "ra.h"
 #include "hash.h"
 #include "net.h"
 #include "sqlNum.h"
 #include "obscure.h"
 #include "hgMaf.h"
 #include "customTrack.h"
 #include "regexHelper.h"
 #include "fieldedTable.h"
 #include "tagRepo.h"
 #include "htmlPage.h"
+#include "hubConnect.h"
 
 struct trackDb *trackDbNew()
 /* Allocate a new trackDb with just very minimal stuff filled in. */
 {
 struct trackDb *tdb;
 AllocVar(tdb);
 tdb->canPack = 2;	/* Unknown value. */
 return tdb;
 }
 
 int trackDbCmp(const void *va, const void *vb)
 /* Compare to sort based on priority; use shortLabel as secondary sort key.
  * Note: parallel code to hgTracks.c:tgCmpPriority */
 {
 const struct trackDb *a = *((struct trackDb **)va);
@@ -113,31 +114,31 @@
 hashAdd(bt->settingsHash, "release", cloneString(releaseTag));
 }
 
 static void trackDbAddInfo(struct trackDb *bt,
         char *var, char *value, struct lineFile *lf)
 /* Add info from a variable/value pair to browser table. */
 {
 char *subbedUrl = NULL;
 if (sameString(var, "track"))
     parseTrackLine(bt, value, lf);
 
 // Since we may have gotten here from an include statement, we
 // need to expand the url relative to the include statement, and
 // not later where the url will be expanded relative to the parent
 // of the include statement
-if (trackSettingIsFile(var))
+if (isHubTrack(bt->track) && trackSettingIsFile(var))
     subbedUrl = htmlExpandUrl(lf->fileName, value);
 if (bt->settingsHash == NULL)
     bt->settingsHash = hashNew(7);
 if (bt->viewHash == NULL)
     bt->viewHash = hashNew(7);
 char *storeValue = cloneString(subbedUrl != NULL ? subbedUrl : value);
 
 // squirrel away views
 if (startsWith("subGroup", var))
     {
     char *ptr = strchr(value, ' ');
     if (ptr)
         *ptr = 0;
     hashAdd(bt->viewHash, value, storeValue);
     if (ptr)