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 <track> in track database <db>" 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/hgTracks.c src/hg/hgTracks/hgTracks.c
index 4a6a891c84c..3ce6f9ba3be 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -10559,31 +10559,31 @@
                "the current chromosome ideogram in PDF</A>\n", ideoPdfFile);
     printf("</UL>\n");
     freez(&pdfFile);
     freez(&ideoPdfFile);
 
     printf("If you require a bitmap image in <b>PNG</b> or <b>TIFF format</b>, note that PDF format \n");
     printf("is vector-based and can be opened in any software that opens PDF/SVG vector files. You can use these to edit the screenshot.\n");
     printf("Many publishers also accept PDF or SVG files for figures. <br><br>\n");
     printf("If your publisher requires bitmap images such as PNG or TIFF, use your vector graphics program to export to these \n");
     printf("formats. For this export, use the publishers recommended dpi (dots per inch value), usually 300 dpi.\n");
 
     // see redmine #1077
     printf("<div style=\"margin-top:15px\">Tips for producing quality images for publication:</div>\n");
     printf("<UL style=\"margin-top:0px\">\n");
     printf("<LI>Add assembly name and chromosome range to the image on the\n"
-        "<A HREF=\"hgTrackUi?g=ruler\">configuration page of the base position track</A>.\n");
+        "<A HREF=\"hgTrackUi?db=%s&g=ruler\">configuration page of the base position track</A>.\n", database);
     printf("<LI>If using the default genes track (e.g. GENCODE for hg38 or UCSC Genes for older assemblies),\n"
            "consider showing only one transcript per gene by turning off splice variants on the track configuration page.\n");
     printf("<LI>Increase the font size and remove the light blue vertical guidelines in the \n"
         "<A HREF=\"hgTracks?hgTracksConfigPage=configure\">image configuration menu</A>.");
     printf("<LI>Change the size of the image in the image configuration menu\n"
             "to make it look more square.\n");
     printf("</UL>\n");
     printf("</div>\n");
 
 
     }
 else
     printf("<BR><BR>PDF format not available");
 
 printf("<a href='%s?%s=%s'><input type='button' VALUE='Return to Browser'></a>\n",