Item type codes should be limited to letters and numbers. When you have item type codes with punctuation in them, it can lead to unexpected search result hits. For instance, if you have items with "BOOK" and "E-BOOK", searches for "E-BOOK" will return hits for "BOOK".
I suspect there are (many) duplicates of this bug but I haven't been able to find them yet.
Created attachment 184531 [details] [review] Bug 40476: Limit item type codes to letters and numbers This patch adds a custom jquery validator method to perform a regex test on item type codes in the admin module. Test plan: 0. Apply the patch 1. Go to http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form 2. Try to input an "Item type" like "abc123+ 3. Note the input turns red and the message "Invalid pattern" appears. 4. Try to input an "Item type" like "ébook" 5. Note that the input is capitalised, it stays black, and there is no warning 6. Try out more combinations of things you'd like to use as item type codes
Tested and works as described. Signed-off-by: Esther Melander <esther@bywatersolutions.com>