Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRegister: Error when affiliation name is longer than 32 chars #841
Comments
For the record, it only fails when MySQL is in some kind of strict mode. In my (default Debian) installation, it does not fail but the value is silently truncated, which we all know and love from MySQL. In the admin interface we do not currently enforce any shortname uniqueness. I doubt there's much to gain from making the self-registered shortnames forcefully unique. Because in self registration we currently accept long names "Utrecht University" and "Universiteit Utrecht" and "Utrecht University " as all new affiliations. Only exact stringwise matches are not accepted. So there's no real expectation of uniqueness for self-declared affiliations, I think. So also not for shortnames? |
A fourth option is to ask the user to also provide a meaningful shortname during registration. |
To me asking the user for a shortname and otherwise generate a unique one from the affiliation name sounds like a good candidate solution. Although just picking either of those is also fine. |
Description of the problem
During registration, if a new affiliation is added with a name longer than 32 characters, the server returns a 500 Internal Server Error page.
Environment
DOMjudge 7.1.3, 7.2.1, master @ aac01de.
Expected behaviour
Either registration should succeed, or there should be a friendly error message.
(I think this is reasonable to expect because the limit is so small.)
Cause
The input from the user is used as both the name and the shortname of the new affiliation. The length limit of the name is 255, while the length limit of the shortname is only 32.
Ideas for fix
I'd be happy to implement one of these, just not sure what the preferred approach would be.
Stack trace