09f26ed9a7dcc52b03b4d3e5b2f97c5177cd9334
max
Mon Sep 21 06:00:40 2026 -0700
Drop the ${hgsid} trackDb variable; add session ids to links in the browser instead
A description page's links can carry the session id without the page itself holding
one. addHgsidToLinks() in utils.js walks the rendered page and appends hgsid to every
<a href> that stays on this host and points into the same cgi-bin directory: a relative
CGI link gets one, a static .html, a link to another host, a mailto and a plain #anchor
do not, and a link that already names a session is left alone. hgc and hgTrackUi call
it through a new jsAddHgsidToLinks(), and hgTracks.js calls it on the track description
popup once the ajax content is in. A link written with a literal $hgsid is rewritten
rather than skipped, so the description pages already deployed in the GenArk hubs work
again.
hVarSubst no longer knows about hgsid: it is out of the trackDb variable list, so
hVarSubstTrackDbHtml is a hub-only pass again and needs no cart, and hVarSubstWithCart
and webIncludeHelpFileSubst, which existed only to resolve it, are gone. The variable
is taken out of the trackDb README and out of the twenty-odd description pages that
used it.
refs #38380
diff --git src/hg/inc/hVarSubst.h src/hg/inc/hVarSubst.h
index adf8ab793c5..1391a609b3d 100644
--- src/hg/inc/hVarSubst.h
+++ src/hg/inc/hVarSubst.h
@@ -1,42 +1,36 @@
/** Handle variable substitutions in strings from trackDb and other
* labels. See trackDb/README for descriptions of values that
* can be substitute. */
/* Copyright (C) 2009 The Regents of the University of California
* See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
#ifndef hVarSubst_h
#define hVarSubst_h
#include "trackDb.h"
-#include "cart.h"
char *hVarSubst(char *desc, struct trackDb *tdb, char *database, char *src);
/* Parse a string and substitute variable references. Return NULL if
* no variable references were found. Error on missing variables (except
* $matrix). desc is a brief description to print on error to help with
* debugging. tdb maybe NULL to only do substitutions based on database
* and organism. See trackDb/README for more information.*/
void hVarSubstInVar(char *desc, struct trackDb *tdb, char *database, char **varPtr);
/* hVarSubst on a dynamically allocated string, replacing string in substitutions
* occur, freeing the old memory if necessary. See hVarSubst for details.
*/
-void hVarSubstWithCart(char *desc, struct cart *cart, struct trackDb *tdb, char *database,
- char **varPtr);
-/* Like hVarSubstInVar, but if cart is non-NULL, $hgsid will be substituted. */
-
void hVarSubstTrackDb(struct trackDb *tdb, char *database);
/* Substitute variables in trackDb shortLabel, longLabel, and html fields. */
-void hVarSubstTrackDbHtml(struct cart *cart, struct trackDb *tdb, char *database);
-/* Substitute variables in a track's description page, at render time, where there is a
- * cart and where $db, $hgsid and $parentTrack resolve to the hub_<id>_ names the CGIs
- * actually use. A hub's html has never been through substitution, so a short list of
- * variables is resolved here. A native page was already done by hgTrackDb, apart from
- * $hgsid, which cannot be baked into the trackDb table because it is per-request.
- * Nothing is an error, so a dollar sign in a description page that was not written with
- * this in mind stays a dollar sign. */
+void hVarSubstTrackDbHtml(struct trackDb *tdb, char *database);
+/* Substitute variables in a hub track's description page, at render time, where $db,
+ * $track and $parentTrack resolve to the hub_<id>_ names the CGIs actually use. A hub's
+ * html has never been through substitution, so a short list of variables is resolved here.
+ * A native page was already done by hgTrackDb, so it is left alone. Nothing is an error,
+ * so a dollar sign in a description page that was not written with this in mind stays a
+ * dollar sign. */
#endif