94041c12e043016875ebd340568bda0ccaf122f6 lrnassar Wed Jul 8 13:53:22 2026 -0700 Add db= to cross-CGI hgTracks/hgTrackUi/hgc links to prevent wrong-assembly errors. refs #37840 Completes the incomplete work from #26892: links from the browser to a different CGI omitted db=, so the target CGI fell back to the cart's db (often wrong), producing "Can't find in track database " errors and broken shared links. Adds the current-assembly db to link builders across hgTracks (chromGraphTrack, expRatioTracks, config ruler and per-track configure links, variation), hgVai, hgFileUi, hgGtexTrackSettings, hgBlat, hgGene, hgNear, the barChart/GTEx faceted UI (facetedBar, barChartUi, gtexUi), and the hgTrackUi group-configure link. diff --git src/hg/hgTracks/variation.c src/hg/hgTracks/variation.c index 1c63eb39a0a..9ff73d3472a 100644 --- src/hg/hgTracks/variation.c +++ src/hg/hgTracks/variation.c @@ -1613,88 +1613,88 @@ if (tg->tdb && sameString(tg->tdb->type, "ld2")) bedLoadLdItem(tg, tg->table, (ItemLoader)ld2Load); else bedLoadLdItem(tg, tg->table, (ItemLoader)ldLoad); tg->canPack = FALSE; } void mapDiamondUi(struct hvGfx *hvg, int xl, int yl, int xt, int yt, int xr, int yr, int xb, int yb, char *name, char *shortLabel, char *trackName) /* Print out image map rectangle that invokes hgTrackUi. */ { if (theImgBox && curImgTrack) { char link[512]; - safef(link,sizeof(link),"%s?%s=%s&g=%s&i=%s", hgTrackUiName(), - cartSessionVarName(), cartSessionId(cart), trackName, name); + safef(link,sizeof(link),"%s?%s=%s&db=%s&g=%s&i=%s", hgTrackUiName(), + cartSessionVarName(), cartSessionId(cart), database, trackName, name); char title[128]; safef(title,sizeof(title),"%s controls", shortLabel); // Add map item to currnent map (TODO: pass in map) // FIXME: What am I going to do about poly cords??? // FIXME: What am I going to do about poly cords??? // FIXME: imgTrackAddMapItem(curImgTrack,link,title, // FIXME: hvGfxAdjX(hvg, xl), yl, // FIXME: hvGfxAdjX(hvg, xt), yt, // FIXME: hvGfxAdjX(hvg, xr), yr, // FIXME: hvGfxAdjX(hvg, xb), yb)); // FIXME: What am I going to do about poly cords??? // FIXME: What am I going to do about poly cords??? warn("Track named %s has called for a POLY map titled '%s controls', but imageV2 doesn't " "yet support this. No map item made.",trackName,shortLabel); } else { hPrintf("\n"); } } void mapTrackBackground(struct track *tg, struct hvGfx *hvg, int xOff, int yOff) /* Print out image map rectangle that invokes hgTrackUi. */ { xOff = hvGfxAdjXW(hvg, xOff, insideWidth); char *track = tg->tdb->parent ? tg->tdb->parent->track : tg->tdb->track; if (theImgBox && curImgTrack) { char link[512]; - safef(link,sizeof(link),"%s?%s=%s&g=%s&i=%s",hgTrackUiName(), - cartSessionVarName(), cartSessionId(cart), track, track); + safef(link,sizeof(link),"%s?%s=%s&db=%s&g=%s&i=%s",hgTrackUiName(), + cartSessionVarName(), cartSessionId(cart), database, track, track); char title[128]; safef(title,sizeof(title),"%s controls", tg->track); // Add map item to currnent map (TODO: pass in map) #ifdef IMAGEv2_SHORT_MAPITEMS if (xOff < insideX && xOff+insideWidth > insideX) warn("mapTrackBackground(%s) map item spanning slices. LX:%d TY:%d RX:%d BY:%d link:[%s]", tg->track,xOff, yOff, xOff+insideWidth, yOff+tg->height, link); #endif//def IMAGEv2_SHORT_MAPITEMS imgTrackAddMapItem(curImgTrack,link,title,xOff, yOff, xOff+insideWidth, yOff+tg->height, tg->track, NULL); } else { hPrintf("height); - hPrintf("HREF=\"%s?%s=%s&c=%s&g=%s&i=%s\"", hgTrackUiName(), - cartSessionVarName(), cartSessionId(cart), chromName, track, track); + hPrintf("HREF=\"%s?%s=%s&db=%s&c=%s&g=%s&i=%s\"", hgTrackUiName(), + cartSessionVarName(), cartSessionId(cart), database, chromName, track, track); mapStatusMessage("%s controls", tg->track); hPrintf(">\n"); } } int ldTotalHeight(struct track *tg, enum trackVisibility vis) /* Return total height. Called before and after drawItems. * Must set height, lineHeight, heightPer */ { tg->lineHeight = tl.fontHeight + 1; tg->heightPer = tg->lineHeight - 1; if ( vis==tvDense || ( tg->limitedVisSet && tg->limitedVis==tvDense ) ) tg->height = tg->lineHeight; else if (winEnd-winStart<250000) tg->height = insideWidth/2;