Loading a terms file with empty terms gives an undecipherable and inconsistent error
Summary
Trying to upload a terms file with empty terms sometimes gives an error, sometimes not, and the error is not helpful.
How to reproduce
- Make a terms .json file where at least one of the terms is the empty string
""
- Load the terms file into the Terms node of an existing corpus node (Terms node > Flower > Upload)
What should happen
- A clear warning or error should systematically appear, stating that the terms file is faulty
What actually happens
- A cryptic error message appears in red at the top of the webpage (see
: the string
"buildPatterns: ERR2"
appears, which helped us devs (with some effort) find the cause of the error, but is absolutely useless for users. - The error message doesn't systematically appear; in particular, it does not happen when the docs list is empty.
- However, if, after 1. having imported the faulty terms file in a corpus without any document, then 2. having created/imported (a) document(s), the user clicks the "Reload (with settings)" action, the error finally appears
- The empty term "appears" in the terms list