da1f0d67fe492b997b07bbebe6e5f4a86170331b angie Wed May 4 10:07:18 2016 -0700 Same as in hgGateway (d30337d4), I forgot to initialize oldVars (thanks Hiram for noticing!) and also wasn't using getDbGenomeClade which handles position reset when db changes. refs #17267#note-5. diff --git src/hg/hgChooseDb/hgChooseDb.c src/hg/hgChooseDb/hgChooseDb.c index df28237..bc19308 100644 --- src/hg/hgChooseDb/hgChooseDb.c +++ src/hg/hgChooseDb/hgChooseDb.c @@ -12,30 +12,31 @@ #include "common.h" #include "cart.h" #include "cartJson.h" #include "cheapcgi.h" #include "hCommon.h" #include "hdb.h" #include "hui.h" #include "jsHelper.h" #include "jsonParse.h" #include "obscure.h" // for readInGulp #include "trackHub.h" #include "web.h" /* Global Variables */ struct cart *cart = NULL; /* CGI and other variables */ +struct hash *oldVars = NULL; /* Old contents of cart before it was updated by CGI */ #define SEARCH_TERM "hgcd_term" static char *getPhotoForGenome(char *genome, char *db) /* If the expected file for this genome's description page photo exists, return the filename. */ { if (db == NULL) db = hDefaultDbForGenome(genome); char baseName[PATH_LEN]; if (sameString("Human", genome)) safecpy(baseName, sizeof(baseName), "human.jpg"); else { safef(baseName, sizeof(baseName), "%s.jpg", hScientificName(db)); subChar(baseName, ' ', '_'); @@ -149,31 +150,32 @@ static void doCartJson() /* Perform UI commands to update the cart and/or retrieve cart vars & metadata. */ { struct cartJson *cj = cartJsonNew(cart); cartJsonRegisterHandler(cj, "getPopularSpecies", getPopularSpecies); cartJsonRegisterHandler(cj, "getDbMenu", getDbMenu); cartJsonRegisterHandler(cj, "getDescriptionHtml", getDescriptionHtml); cartJsonExecute(cj); } static void doMainPage() /* Send HTML with javascript to bootstrap the user interface. */ { //#*** A lot of this is copied from hgIntegrator... libify! -char *db = cartUsualString(cart, "db", hDefaultDb()); +char *db = NULL, *genome = NULL, *clade = NULL; +getDbGenomeClade(cart, &db, &genome, &clade, oldVars); webStartWrapperDetailedNoArgs(cart, trackHubSkipHubName(db), "", "UCSC Genome Browser Databases", TRUE, FALSE, TRUE, TRUE); // Ideally these would go in the
puts(""); puts(""); puts("