http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Bug #: 7628 Summary: Required format is not enforced for Patron Categories Classification: Unclassified Change sponsored?: --- Product: Koha Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons AssignedTo: kyle.m.hall@gmail.com ReportedBy: veron@veron.ch QAContact: koha.sekjal@gmail.com CC: gmcharlt@gmail.com Problem: -------- If you use characters like '+' in category code, like '+TEST', you can not edit or delete the category. Required format is not enforced. Solution: --------- In categorie.tt, function Check(ff), trim user input and test it for unwanted characters. Instead of: ----------- if (ff.categorycode.value.length==0) { ok=1; _alertString += _("- categorycode missing") + "\n"; } Put: ---- ff.categorycode.value = ff.categorycode.value.trim(); if (ff.categorycode.value.length==0) { ok=1; _alertString += _("- categorycode missing") + "\n"; } else{ var patt=/^[a-zA-Z0-9\-_]+$/g; if ( !patt.test(ff.categorycode.value) ) { ok=1; _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n"; } } -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.