919ecaa0c76c01938c9e9091ecef58581ea9c8f1
chmalee
  Wed May 1 08:49:55 2024 -0700
Sort genark species in asc order instead of desc order, refs #33572

diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c
index febd4e7..57b64de 100644
--- src/hg/hgGateway/hgGateway.c
+++ src/hg/hgGateway/hgGateway.c
@@ -969,31 +969,31 @@
 
 static struct gHubMatch *searchGenark(char *term)
 /* Search through the genark table for hubs matches term */
 {
 char *genarkPrefix = cfgOption("genarkHubPrefix");
 if (genarkPrefix == NULL)
     return NULL;
 
 struct gHubMatch *gHubMatchList = NULL;
 char *genarkTbl = genarkTableName();
 struct sqlConnection *conn = hConnectCentral();
 if (sqlTableExists(conn, genarkTbl))
     {
     char query[1024];
     sqlSafef(query, sizeof(query), "select * from %s where "
-             "(gcAccession like '%%%s%%' or scientificName like '%%%s%%' or commonName like '%%%s%%' or asmName like '%%%s%%') order by commonName",
+             "(gcAccession like '%%%s%%' or scientificName like '%%%s%%' or commonName like '%%%s%%' or asmName like '%%%s%%') order by commonName ASC",
              genarkTbl, term, term, term, term);
     struct genark *matchList = genarkLoadByQuery(conn, query);
     gHubMatchList = filterGenarkMatches(genarkPrefix, matchList);
     }
 hDisconnectCentral(&conn);
 return gHubMatchList;
 }
 
 static char *getSearchTermUpperCase()
 /* If we don't have the SEARCH_TERM cgi param, exit with an HTTP Bad Request response.
  * If we do, convert it to upper case for case-insensitive matching and return it. */
 {
 pushWarnHandler(htmlVaBadRequestAbort);
 pushAbortHandler(htmlVaBadRequestAbort);
 char *cgiTerm = cgiOptionalString(SEARCH_TERM);