7d74f16b6443b2155b8638052919ed4952a6e786 chmalee Wed Jun 3 13:00:02 2026 -0700 Fix table schema button for myVariants tracks, no redmine diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index ab7e4125034..9746bad24bb 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -610,48 +610,56 @@ printLongWithCommas(stdout, sqlTableSize(conn, table)); hPrintf("<BR>\n"); if (asObj != NULL) hPrintf("<B>Format description:</B> %s<BR>", asObj->comment); describeFields(CUSTOM_TRASH, table, asObj, conn); webNewSection("Sample Rows"); printSampleRows(10, conn, ct->dbTableName); printTrackHtml(ct->tdb); hFreeConn(&conn); } static void showSchemaCt(char *db, char *table) /* Show schema on custom track. */ { -struct customTrack *ct = ctLookupName(table); +/* Accept the qualified myVariants storage form ("customDataNN.myVariants_<user>") + * as well as the bare track name; the ct list is keyed on the bare track name. */ +char *dot = strchr(table, '.'); +char *trackName = (dot != NULL && isMyVariantsTrack(dot + 1)) ? dot + 1 : table; +struct customTrack *ct = ctLookupName(trackName); char *type = ct->tdb->type; if (startsWithWord("wig", type) || startsWithWord("bigWig", type)) showSchemaCtWiggle(table, ct); else if (startsWithWord("chromGraph", type)) showSchemaCtChromGraph(table, ct); else if (startsWithWord("bed", type) || startsWithWord("bedGraph", type)) showSchemaCtBed(table, ct); else if (startsWithWord("bedMethyl", type)) showSchemaCtBed(table, ct); else if (startsWithWord("maf", type)) showSchemaCtMaf(table, ct); else if (startsWithWord("array", type)) showSchemaCtArray(table, ct); else if (isMyVariantsType(type)) { + if (ct->dbTableName == NULL) + ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart); + if (ct->dbTableName == NULL) + errAbort("Cannot access myVariants track %s; the share may have been revoked.", trackName); struct asObject *asObj = myVariantsAsObj(); - showSchemaWithAsObj(db, table, ct, asObj); + showSchemaWithAsObj(db, trackName, ct, asObj); asObjectFree(&asObj); } else if (sameWord("bedDetail", type)) { struct asObject *asObj = bedDetailAsObj(); showSchemaWithAsObj(db, table, ct, asObj); asObjectFree(&asObj); } else if (sameWord("pgSnp", type)) { struct asObject *asObj = pgSnpAsObj(); showSchemaWithAsObj(db, table, ct, asObj); asObjectFree(&asObj); } else if (sameWord("barChart", type)) @@ -706,31 +714,32 @@ /* Show schema to open html page. */ { boolean isTabix = FALSE; if (isHubTrack(table)) showSchemaHub(db, table); else if (isBigBed(database, table, curTrack, ctLookupName)) showSchemaBigBed(table, tdb); else if (isLongTabixTable(table)) showSchemaLongTabix(table, tdb); else if (isBamTable(table)) showSchemaBam(table, tdb); else if (isVcfTable(table, &isTabix)) showSchemaVcf(table, tdb, isTabix); else if (isHicTable(table)) showSchemaHic(table, tdb); -else if (isCustomTrack(table)) +else if (isCustomTrack(table) || isMyVariantsTrack(table) || + (strchr(table, '.') != NULL && isMyVariantsTrack(strchr(table, '.') + 1))) showSchemaCt(db, table); else if (sameWord(table, WIKI_TRACK_TABLE)) showSchemaWiki(tdb, table); else if (isBigWig(database, table, curTrack, ctLookupName) && !hTableExists(db, table)) showSchemaBigWigNoTable(db, table, tdb); else if (tdb && sameString(tdb->type, "lorax")) showSchemaBigBed(table, tdb); else showSchemaDb(db, tdb, table); } void doTableSchema(char *db, char *table, struct sqlConnection *conn) /* Show schema around table (which is not described by curTrack). */ { struct trackDb *tdb = NULL;