e11c7472ea2049f260356eed98b572791d6fa422
braney
  Fri Feb 17 18:29:59 2012 -0800
make sure we get the right trackDb entry for the current table when we're getting statistics.  #7047
diff --git src/hg/hgTables/wiggle.c src/hg/hgTables/wiggle.c
index 0721f3a..1d83ae6 100644
--- src/hg/hgTables/wiggle.c
+++ src/hg/hgTables/wiggle.c
@@ -930,31 +930,34 @@
 void doOutWigData(struct trackDb *track, char *table, struct sqlConnection *conn)
 /* Return wiggle data in variableStep format. */
 {
 doOutWig(track, table, conn, wigOutData);
 }
 
 void doOutWigBed(struct trackDb *track, char *table, struct sqlConnection *conn)
 /* Return wiggle data in bed format. */
 {
 doOutWig(track, table, conn, wigOutBed);
 }
 
 void doSummaryStatsWiggle(struct sqlConnection *conn)
 /* Put up page showing summary stats for wiggle track. */
 {
-struct trackDb *track = curTrack;
+// grab the right trackDb for the current table.  The curTrack variable
+// has the composite trackDb in it
+struct trackDb *track  = hTrackDbForTrack(database, curTable);
+
 char *table = curTable;
 struct region *region, *regionList = getRegions();
 char *regionName = getRegionName();
 long long regionSize = 0;
 long long gapTotal = 0;
 long startTime = 0, wigFetchTime = 0;
 char splitTableOrFileName[256];
 struct customTrack *ct = NULL;
 boolean isCustom = FALSE;
 struct wiggleDataStream *wds = NULL;
 unsigned long long valuesMatched = 0;
 int regionCount = 0;
 int regionsDone = 0;
 unsigned span = 0;
 char *dataConstraint;