Reason for place rule "Name cannot start with a number"?

for what it’s worth, any place has a separate Name and Display Name. as far as i can tell, the Display Name can start with a number. so you could set up a place with a Name that begins with a non-number but still begin its Display Name with a number. the only things that i can tell the Name is being used for (though i didn’t look very hard) are (in part) the place slug (the alternative reference to place id), links to Wikipedia, and possibly links to match up with Google places.

this is the discussion that revealed a need to handle place names that were numeric: https://forum.inaturalist.org/t/places-and-constituencies/9103. there’s a Github issue referenced in that thread, which was originally written to disallow purely numeric names, but which was modified and implemented to disallow names beginning with numbers.

it’s not noted why exactly the issue was modified, but i suspect it has to do with the place slug being based (in part) on the place name. a lot of points in the system will dynamically respond to either a place id or a place slug. probably the way the system decides whether to treat an input as a place id or a place slug is by look at whether it starts with a number. it’s probably a much bigger change to change the way the system distinguishes between id or slug than to simply prevent names that begin with numbers (thereby preventing slugs beginning with numbers). just guesses…

EDIT: actually, i’m looking at the Github issue, and it doesn’t look like it was officially noted as being closed, although there definitely is a validation in the place screen that prevents names beginning with numbers. i’m not going to dig through the code and all the history for it, but maybe this validation is not actually new? maybe it was there already, and maybe the problem place was added via a process that did not involve the usual place creation / edit screen?

1 Like