3670b9f2a58342dcc0629bad9d221a9d5e4ae5ff
braney
  Thu Apr 23 14:39:37 2026 -0700
hgGene: render all sections and the Methods page for QuickLift knownGene clicks. refs #36370

- synonym.c: wrap the coord-qualified kgProteinID lookup in emptyForNull.
After quickLiftGenePred() rewrites curGeneChrom/Start/End to destination
coords, the same-transaction lookup against the source assembly's
knownGene table misses and sqlGetField returns NULL; strstr(NULL, "-")
on the next line segfaulted, truncating the page at <B>Protein: </B>
so GeneReviews, Methods, and any later sections never rendered.
- hgGene.c doKgMethod: when the track is quickLifted and the hub trackDb
has no html, refetch the trackDb from quickLiftDb using
trackHubSkipHubName(tableName). The Methods "Click here" link was
landing on a page whose entire body was printf("%s", NULL) => "(null)".

Verified on hgwdev-braney with Gerardo's repro (hg38 -> hs1 QuickLift,
chr7:156982676-156996015 window, MNX1 / ENST00000469500.5): all 13
sections now render and Methods serves the full GENCODE description.
No change on the native hg38 path.

diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 6e356ce5414..9fedf5076bd 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -706,31 +706,39 @@
 sqlFreeResult(&sr);
 if (gp == NULL)
     errAbort("getCurGenePred: Can't find %s", query);
 return gp;
 }
 
 void doKgMethod()
 /* display knownGene.html content (UCSC Known Genes
  * Method, Credits, and Data Use Restrictions) */
 {
 cartWebStart(cart, database, "Methods, Credits, and Use Restrictions");
 char *tableName = cartUsualString(cart, hggType, NULL);
 if (tableName == NULL)
     tableName = "knownGene";
 struct trackDb *tdb = hTrackDbForTrack(database, tableName);
-hPrintf("%s", tdb->html);
+// QuickLift: hub trackDb has no html; pull it from the source assembly's native track.
+char *liftDbSetting = (tdb != NULL) ? trackDbSetting(tdb, "quickLiftDb") : NULL;
+if (liftDbSetting != NULL && isEmpty(tdb->html))
+    {
+    struct trackDb *srcTdb = hTrackDbForTrack(liftDbSetting, trackHubSkipHubName(tableName));
+    if (srcTdb != NULL && isNotEmpty(srcTdb->html))
+        tdb = srcTdb;
+    }
+hPrintf("%s", emptyForNull(tdb->html));
 cartWebEnd();
 }
 
 static void quickLiftGenePred(struct cart *cart, struct trackDb *tdb)
 // map curGenePred to current db
 {
 char *chrom = cloneString(cartString(cart, hggChrom));
 int start = atoi(cartString(cart, hggStart));
 int end = atoi(cartString(cart, hggEnd));
 char *quickLiftFile = cloneString(trackDbSetting(tdb, "quickLiftUrl"));
 char *linkFileName = bigChainGetLinkFile(quickLiftFile);
 struct hash *chainHash = newHash(8);
 
 struct chain *chain, *chainList = chainLoadIdRangeHub(NULL, quickLiftFile, linkFileName, chrom, start, end, -1);
 for(chain = chainList; chain; chain = chain->next)