166abc2cdfefcaa86521ee296e9ede826c5354ac
braney
  Fri May 1 13:02:09 2026 -0700
hgc: resolve dataVersion path for quickLifted tracks, refs #37489

checkDataVersion() skipped path resolution when tdb->table looked like
a hub track, so a quickLifted ClinVar stanza with
dataVersion /gbdb/$D/bbi/clinvar/version.txt
displayed the raw setting (with literal $D) instead of opening the
file. When quickLiftDb is set, allow the path-substitution branch and
use the source assembly for $D so /gbdb/<srcDb>/... resolves.

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 9ce7959c8b6..52d2fea8a72 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -10589,36 +10589,41 @@
 struct dyString *fUrl = subMulti(eUrl->string, fieldCount, fieldNames, fieldVals);
     return fUrl->string;
 }
 
 char *checkDataVersion(char *database, struct trackDb *tdb)
 /* see if trackDb has a dataVersion setting and check that file for version */
 {
 // try the metadata
 metadataForTable(database, tdb, NULL);
 char *version = (char *)metadataFindValue(tdb, "dataVersion");
 
 // try trackDb itself, this automatically will go up the hierarchy
 if (version == NULL)
     version = trackDbSetting(tdb, "dataVersion");
 
-if (version != NULL)
+if (version != NULL && startsWith("/", version))
     {
-    // dataVersion can also be the path to a local file, for otto tracks
-    if (!trackHubDatabase(database) && !isHubTrack(tdb->table) && startsWith("/", version))
+    // dataVersion can also be the path to a local file, for otto tracks.
+    // For quickLifted tracks the file lives on the source assembly, so
+    // substitute $D using quickLiftDb rather than the destination database.
+    char *liftDb = trackDbSetting(tdb, "quickLiftDb");
+    char *resolveDb = liftDb ? liftDb : database;
+    if (liftDb != NULL ||
+        (!trackHubDatabase(database) && !isHubTrack(tdb->table)))
         {
-        char *path = replaceInUrl(version, "", NULL, database, "", 0, 0, tdb->track, FALSE, NULL);
+        char *path = replaceInUrl(version, "", NULL, resolveDb, "", 0, 0, tdb->track, FALSE, NULL);
         struct lineFile* lf = lineFileMayOpen(path, TRUE);
         if (lf)
             version = lineFileReadAll(lf);
         else
             version = NULL;
         lineFileClose(&lf);
         }
     }
 return version;
 }
 
 void printDataVersion(char *database, struct trackDb *tdb)
 /* If this annotation has a dataVersion setting, print it.
  * check hgFixed.trackVersion, meta data and trackDb 'dataVersion'. */
 {