[Koha-bugs] [Bug 7628] New: Required format is not enforced for Patron Categories

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 1 13:10:48 CET 2012


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 at gmail.com
        ReportedBy: veron at veron.ch
         QAContact: koha.sekjal at gmail.com
                CC: gmcharlt at 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.


More information about the Koha-bugs mailing list