36d3c6cb9ba952bad9d56d2e2b093d11b8aa1c84
galt
Fri Nov 21 14:57:08 2014 -0800
Fixes #12687. Changed to show only the first 10 missing identifiers, AND it provides a link that the user can click to get a complete list of all missing identifiers.
diff --git src/hg/hgTables/identifiers.c src/hg/hgTables/identifiers.c
index d29cf5e..e2dd451 100644
--- src/hg/hgTables/identifiers.c
+++ src/hg/hgTables/identifiers.c
@@ -461,53 +461,62 @@
slReverse(&missingTerms);
carefulClose(&f);
cartSetString(cart, hgtaIdentifierDb, database);
cartSetString(cart, hgtaIdentifierTable, curTable);
cartSetString(cart, hgtaIdentifierFile, tn.forCgi);
if (saveIdText)
freez(&idTextForLf);
else
cartRemove(cart, hgtaPastedIdentifiers);
int missingCount = totalTerms - foundTerms;
if (missingCount > 0)
{
char *xrefTable, *aliasField;
getXrefInfo(conn, &xrefTable, NULL, &aliasField);
boolean xrefIsSame = xrefTable && sameString(curTable, xrefTable);
+ struct tempName tn;
+ trashDirFile(&tn, "hgt/missingIds", cartSessionId(cart), ".tmp");
+ FILE *f = mustOpen(tn.forCgi, "w");
int exampleCount = 0;
for (term = missingTerms; term != NULL; term = term->next)
{
- dyStringPrintf(exampleMissingIds, "%s\n", term->name);
+ if (exampleCount < 10)
+ {
++exampleCount;
- if (exampleCount >= 20)
- break;
+ dyStringPrintf(exampleMissingIds, "%s\n", term->name);
}
+ fprintf(f, "%s\n", term->name);
+ }
+ carefulClose(&f);
+
+ dyStringPrintf(exampleMissingIds, "\nComplete list of missing identifiers\n", tn.forHtml);
+
warn("Note: %d of the %d given identifiers have no match in "
"table %s, field %s%s%s%s%s. "
"Try the \"describe table schema\" button for more "
"information about the table and field.\n"
"%d %smissing identifier(s):\n"
"%s\n",
(totalTerms - foundTerms), totalTerms,
curTable, idField,
(xrefTable ? (xrefIsSame ? "" : " or in alias table ") : ""),
(xrefTable ? (xrefIsSame ? "" : xrefTable) : ""),
(xrefTable ? (xrefIsSame ? " or in field " : ", field ") : ""),
(xrefTable ? aliasField : ""),
exampleCount,
exampleCount < missingCount ? "example " : "",
- dyStringCannibalize(&exampleMissingIds)
+ exampleMissingIds->string
);
webNewSection("Table Browser");
}
lmCleanup(&lm);
hashFree(&matchHash);
}
else
{
cartRemove(cart, hgtaIdentifierFile);
}
mainPageAfterOpen(conn);
htmlClose();
}
char *identifierFileName()