f3525939f7d36dac2de9cf4194f4f0695d1f6148
chmalee
  Thu Mar 9 09:23:05 2023 -0800
Fix schema page when a non-assembly database table is selected out of a joiner related track, found by Jairo in #30730-note4

diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c
index 597e92b..aada220 100644
--- src/hg/hgTables/schema.c
+++ src/hg/hgTables/schema.c
@@ -401,32 +401,35 @@
 if (date != NULL)
     printf("&nbsp&nbsp<B> Data last updated:&nbsp;</B>%s<BR>\n", date);
 if (asObj != NULL)
     hPrintf("<B>Format description:</B> %s<BR>", asObj->comment);
 
 if (cartTrackDbIsNoGenome(db, table))
     hPrintf(" Note: genome-wide queries are not available for this table.");
 else
     {
     hPrintf("<B>On download server: </B>");
     hPrintf("<A HREF='https://hgdownload.soe.ucsc.edu/goldenPath/%s/database/'>MariaDB table dump directory</A><BR>", db);
     }
 
 describeFields(db, splitTable, asObj, conn);
 
+if (tdbForConn && sameString(tdbForConn->track, table))
+    {
     struct trackDb *childTdb = tdbForTrack(db, table, NULL);
     addNotesForBbiTables(childTdb, conn);
+    }
 
 jpList = joinerRelate(joiner, db, table, NULL);
 
 /* sort and unique list */
 slUniqify(&jpList, joinerPairCmpOnAandB, joinerPairFree);
 
 if (jpList != NULL)
     {
     webNewSection("Connected Tables and Joining Fields");
     for (jp = jpList; jp != NULL; jp = jp->next)
 	{
 	if (cartTrackDbIsAccessDenied(jp->b->database, jp->b->table))
 	    continue;
 	struct joinerSet *js = jp->identifier;
 	boolean aViaIndex, bViaIndex;