[Bug 7628] New: Required format is not enforced for Patron Categories
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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marc@msys.ch, | |veron@veron.ch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 Status|NEW |ASSIGNED Version|unspecified |master Assignee|kyle.m.hall@gmail.com |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #1 from Marc Véron <veron@veron.ch> --- Created attachment 10918 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10918&action=edit Bug 7628 - Required format is not enforced for Patron Categories Enforces category code with allowed characters only. Test plan: - Before applying patch, create a category code like Test+ - Try to delete category with this code -> does not work - Apply patch - Try to create category with code containg other characters than letters, numbers, - and _ - Result: You are not allowed to do so, appropriate message pops up -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 10921 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10921&action=edit Bug 7628 - Required format is not enforced for Patron Categories Enforces category code with allowed characters only. Test plan: - Before applying patch, create a category code like Test+ - Try to delete category with this code -> does not work - Apply patch - Try to create category with code containg other characters than letters, numbers, - and _ - Result: You are not allowed to do so, appropriate message pops up Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10918|0 |1 is obsolete| | Attachment #10921|0 |1 is obsolete| | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 10922 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10922&action=edit Bug 7628 - Required format is not enforced for Patron Categories Enforces category code with allowed characters only. Test plan: - Before applying patch, create a category code like Test+ - Try to delete category with this code -> does not work - Apply patch - Try to create category with code containg other characters than letters, numbers, - and _ - Result: You are not allowed to do so, appropriate message pops up Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Small patch that does what it says. I'm not sure why someone would put a "+" into a category code, but data validation is always a good thing, and without it you stumble into the problems that Marc has outlined. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10922|0 |1 is obsolete| | --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Created attachment 10923 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10923&action=edit [SIGNED-OFF] Bug 7628 - Required format is not enforced for Patron Categories Enforces category code with allowed characters only. Test plan: - Before applying patch, create a category code like Test+ - Try to delete category with this code -> does not work - Apply patch - Try to create category with code containg other characters than letters, numbers, - and _ - Result: You are not allowed to do so, appropriate message pops up Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 11034 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11034&action=edit Bug 7628: Escape characters for categorycode [alternative patch] This patch escape the following characters for categorycode: &, @, /, ;, :, =, +, ? and $ QA Comments: The patch works but it does not allow to delete categorycode with a '+' character. That could be considered as a bug for instance in this situation. I think, but I am not sure, the patch I propose is more adapted for this issue. Marc and David, what do you think about this patch ? For discussion... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #7 from Marc Véron <veron@veron.ch> --- Jonathan, When our librarians tested Koha for the first time they wanted to have some categories similar to "KIDS 4 +" Then they wanted to delete the code and did not succeed. My patch would have prevented them to enter "illegal" characters (and to have a user experience like 'It does not work'). And if we do not allow to enter illegal characters there is no need to delete entries with illegal characters. I think the main question is: What characters should be / are allowed with category codes? I had a look at the manual for 3.8: http://manual.koha-community.org/3.8/en/patscirc.html#patcats -Snip--------------- The 'Category Code' is an identifier for your new code. Important The category code is limited to 10 characters (numbers and letters) -End snip--------------- Your patch assumes that &, @, /, ;, :, =, +, ? and $ are legal characters. Are they (without having side effects at other places in Koha)? Should all characters be allowed? What was (historically) the reason for the restriction in the manual? Why are the codes upper cased by the existing JavaScript? If there are no side effects, your patch is the better solution, because it gives the useres more flexiblity to choose a 'speaking' code. (Manual should then be updated, though). If we have to expect side effects, I would prefer my restricion on data entry. Marc -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- The solution may be a combination of these 2 patchs. It would allow restriction (from documention) to always be guaranted and existing wrong-formatted category code to be deleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #9 from Marc Véron <veron@veron.ch> --- Agree. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #11034|0 |1 is obsolete| | --- Comment #10 from Marc Véron <veron@veron.ch> --- Created attachment 11072 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11072&action=edit [SIGNED-OFF] Bug 7628: Escape '+' characters for categorycode uri escape the following characters: &, @, /, ;, :, =, +, ? and $ Signed-off-by: Marc Veron <veron@veron.ch> Test and sign off second patch (independently from first patch). Added categories like '+zwoelf' or '? Test' before applying the patch. Deletion was not possible. After applying patch deletion is possible, patch works as expected. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |paul.poulain@biblibre.com --- Comment #11 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: small patch, test-qa.pl OK, passes QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|master |rel_3_8 QA Contact|koha.sekjal@gmail.com |paul.poulain@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 --- Comment #12 from Paul Poulain <paul.poulain@biblibre.com> --- follow-up comment: would be good to add the same control for itemtypes and branches, because I'm not sure at all having them with a special character will work... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7628 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #13 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x, will be in 3.8.4 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org