d0df5dc6ead611a45dda4ccbd0da5e5917ad3532
chmalee
  Wed May 1 16:18:42 2019 -0700
Reverting the missing children check after lots of discussion, refs #23418

diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c
index 33acc6b..fe807dd 100644
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@ -776,47 +776,45 @@
 static void validateOneTrack( struct trackHub *hub, 
     struct trackHubGenome *genome, struct trackDb *tdb)
 /* Validate a track's trackDb entry. */
 {
 /* Check for existence of fields required in all tracks */
 requiredSetting(hub, genome, tdb, "shortLabel");
 char *shortLabel  = trackDbSetting(tdb, "shortLabel");
 memSwapChar(shortLabel, strlen(shortLabel), '\t', ' ');
 requiredSetting(hub, genome, tdb, "longLabel");
 char *longLabel  = trackDbSetting(tdb, "longLabel");
 memSwapChar(longLabel, strlen(longLabel), '\t', ' ');
 
 /* Forbid any dangerous settings that should not be allowed */
 forbidSetting(hub, genome, tdb, "idInUrlSql");
 
-// check that current stanza (via trackDbLocalSetting) is not using the old
-// style "superTrack parentName visibility" subtrack declaration
+// subtracks is not NULL if a track said we were its parent
+if (tdb->subtracks != NULL)
+    {
     boolean isSuper = FALSE;
-char *superTrack = trackDbLocalSetting(tdb, "superTrack");
+    char *superTrack = trackDbSetting(tdb, "superTrack");
     if ((superTrack != NULL) && startsWith("on", superTrack))
 	isSuper = TRUE;
 
-if (isSuper || trackDbLocalSetting(tdb, "compositeTrack") || trackDbLocalSetting(tdb, "container") || trackDbLocalSetting(tdb, "view"))
+    if (!(trackDbSetting(tdb, "compositeTrack") ||
+          trackDbSetting(tdb, "container") || 
+	  isSuper))
         {
-    // subtracks is not NULL if a track said we were its parent
-    // but generate a more helpful error if a track should have children but doesn't
-    if (tdb->subtracks == NULL)
-        errAbort("Track %s is declared superTrack, compositeTrack or container but has no subtracks in hub %s genome %s", tdb->track, hub->url, genome->name);
+	errAbort("Parent track %s is not compositeTrack, container, or superTrack in hub %s genome %s", 
+		tdb->track, hub->url, genome->name);
 	}
-else if (tdb->subtracks != NULL)
-    {
-    errAbort("Parent track %s is not compositeTrack, container, or superTrack in hub %s genome %s",  tdb->track, hub->url, genome->name);
     }
 else
     {
     /* Check type field. */
     char *type = requiredSetting(hub, genome, tdb, "type");
     if (! isCustomComposite(tdb))
         {
         if (startsWithWord("mathWig", type) )
             {
             requiredSetting(hub, genome, tdb, "mathDataUrl");
             }
         else 
             {
             if (!(startsWithWord("wig", type)||  startsWithWord("bedGraph", type)))
                 {
@@ -1238,45 +1236,15 @@
     else if (startsWithWord("halSnake", type))
         {
         char *errString;
         int handle = halOpenLOD(bigDataUrl, &errString);
         if (handle < 0)
             errAbort("HAL open error: %s", errString);
         if (halClose(handle, &errString) < 0)
             errAbort("HAL close error: %s", errString);
         }
 #endif
     else
         errAbort("unrecognized type %s in genome %s track %s", type, genome->name, tdb->track);
     freez(&bigDataUrl);
     }
 }
-
-void hubCheckGenomeDescription(struct trackHub *hub, struct trackHubGenome *genome)
-/* Warn about missing or incorrect htmlPath settings for each genome in an assembly hub */
-{
-if (genome->twoBitPath != NULL)
-    {
-    char *htmlPath = hashFindVal(genome->settingsHash, "htmlPath");
-    if (htmlPath == NULL)
-        warn("warning: htmlPath setting missing for genome %s", genome->name);
-    else
-        {
-        // check that file actually exists
-        if (!udcExists(htmlPath))
-            warn("warning: htmlPath file does not exist %s", htmlPath);
-        }
-    }
-}
-
-void hubCheckHubDescription(struct trackHub *hub)
-/* Warn about missing or incorrect description page for hub */
-{
-if (!hub->descriptionUrl)
-    warn("warning: descriptionUrl setting missing from %s", hub->url);
-else
-    {
-    // check that file actually exists
-    if (!udcExists(hub->descriptionUrl))
-        warn("warning: descriptionUrl error: file does not exist %s", hub->descriptionUrl);
-    }
-}