4bc6084f77a95eaacd21697240e0cf8762cec9cd braney Thu Sep 6 15:19:10 2018 -0700 if db is not in URL, but genome is, use it for db #22012 diff --git src/hg/lib/web.c src/hg/lib/web.c index 0b9b315..317a2bd 100644 --- src/hg/lib/web.c +++ src/hg/lib/web.c @@ -880,30 +880,33 @@ * consistent. Detect changes and reset db-specific cart variables. * Save db, genome and clade in the cart so it will be consistent hereafter. * The order of preference here is as follows: * If we got a request that explicitly names the db, that takes * highest priority, and we synch the organism to that db. * If we get a cgi request for a specific organism then we use that * organism to choose the DB. If just clade, go from there. * In the cart only, we use the same order of preference. * If someone requests an Genome we try to give them the same db as * was in their cart, unless the Genome doesn't match. */ { boolean gotClade = hGotClade(); *retDb = cgiOptionalString(dbCgiName); +if (*retDb == NULL) // if db is not in URL, but genome is, use it for db + *retDb = cgiOptionalString(hgHubGenome); + *retGenome = cgiOptionalString(orgCgiName); *retClade = cgiOptionalString(cladeCgiName); /* Was the database passed in as a cgi param? * If so, it takes precedence and determines the genome. */ if (*retDb && hDbExists(*retDb)) { *retGenome = hGenome(*retDb); } /* If no db was passed in as a cgi param then was the organism (a.k.a. genome) * passed in as a cgi param? * If so, the we use the proper database for that genome. */ else if (*retGenome && !sameWord(*retGenome, "0")) { *retDb = getDbForGenome(*retGenome, cart);