[Bug 14620] New: Contact information validations
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Bug ID: 14620 Summary: Contact information validations Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: larit@student.uef.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14590 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14590 [Bug 14590] Checkboxes should be disabled without valid contact information in messaging preferences -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |larit@student.uef.fi |ity.org | Depends on| |5685 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5685 [Bug 5685] Validation of email address field -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #1 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41461 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41461&action=edit Bug 14620 - Contact information validations I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14536 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14536 [Bug 14536] PageObject-pattern base implementation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #2 from Lari Taskula <larit@student.uef.fi> --- (In reply to Lari Taskula from comment #1)
Created attachment 41461 [details] [review] Bug 14620 - Contact information validations
Centralizes email and phone number validations into Koha::Validation. Adds two new system preferences, 'ValidateEmailAddress' and 'ValidatePhoneNumber', which determine whether to use the validations or not. Email address validation uses Email::Valid module introduced in Bug 5685. Email can be verified via Koha::Validation::validate_email("email@address.com"). Phone number validation uses regex to validate phone numbers. The system preference, ValidatePhoneNumber, let's you define which regex you want to use. In the patch there is two different phone number validators implemented, (international and Finnish). Anyone can easily create their own regex for his local use. Validations are both client- and server-side. The following test plan applies to memberentry.pl, opac-memberentry.pl and opac-messaging.pl. Test plan: 1. Apply the patch (and run updatedatabase.pl). 2. Set system preferences ValidateEmailAddress to "Enable" and ValidatePhoneNumber to "International Phone Numbers". 3. Navigate to edit user contact informations in Staff client and OPAC. 4. Make sure JavaScript is enabled. 5. Insert invalid email (e.g. "invalid") and invalid phone number ("+123invalid") and send the form. 6. Confirm that form will not be submitted and errors will be given. 7. Disable JavaScript. 8. Try sending the form again. 9. Confirm that form will be submitted but errors will be given on top of the form. 10. Observe that none of the changes are accepted. 11. Set system preferences ValidateEmailAddress to "Disable" and ValidatePhoneNumber to "none". 12. Repeat step 3-9 but observe that errors will not be given and changes will be submitted and saved. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |j.kylmala@gmail.com --- Comment #3 from Joonas Kylmälä <j.kylmala@gmail.com> --- Phone number validation still accepts trailing (and I think also leading) whitespaces. Didn't figure out any fix to this yet, so if anyone has ideas of how to fix this, they're welcome! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #4 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41469&action=edit Bug 14620 - Whitespace fix for validations This fix trims emails and phone numbers just before form is sent. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41469|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #5 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41470&action=edit Bug 14620 - Whitespace fix for validations This fix trims emails and phone numbers just before form is sent. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41470|0 |1 is obsolete| | --- Comment #6 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41471 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41471&action=edit Bug 14620 - Whitespace fix for validations This fix trims emails and phone numbers just before form is sent. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41471|0 |1 is obsolete| | --- Comment #7 from Joonas Kylmälä <j.kylmala@gmail.com> --- Created attachment 41472 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41472&action=edit Bug 14620 - Whitespace fix for validations This fix trims emails and phone numbers just before form is sent. Fixes the invalid syntax used in JQuery's .on() functions' argument. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41461|0 |1 is obsolete| | --- Comment #8 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41502 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41502&action=edit Bug 14620 - Contact information validations I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41472|0 |1 is obsolete| | --- Comment #9 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41527 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41527&action=edit Bug 14620 - Whitespace fix for validations This fix trims emails and phone numbers just before form is sent. Fixes the invalid syntax used in JQuery's .on() functions' argument. Removes the trimming for click events as change event should be enough. Test plan: 1. Apply the patches (and run updatedatabase.pl). 2. Set system preferences ValidateEmailAddress to "Enable" and ValidatePhoneNumber to "International Phone Numbers". 3. Make sure JavaScript is enabled. 4. Navigate to edit user contact informations in Staff client and OPAC. 5. Clear email and phone fields. 6. Insert whitespaces to email and phone fields and submit the form. 7. Edit patron. 8. Observe that there are no longer whitespaces in email and phone fields. 9. Insert invalid email (e.g. "invalid") and invalid phone number ("+123invalid") and send the form. 10. Confirm that form will not be submitted and errors will be given. 11. Disable JavaScript. 12. Insert invalid email and invalid phone number 13. Try sending the form again. 14. Confirm that form will be submitted but errors will be given on top of the form. 15. Observe that none of the changes are accepted. 16. Set system preferences ValidateEmailAddress to "Disable" and ValidatePhoneNumber to "none". 17. Repeat step 3-9 but observe that errors will not be given and changes will be submitted and saved. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|14536 |7174 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7174 [Bug 7174] Authentication rewriting http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14536 [Bug 14536] PageObject-pattern base implementation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14509 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41502|0 |1 is obsolete| | Attachment #41527|0 |1 is obsolete| | --- Comment #10 from Joonas Kylmälä <j.kylmala@gmail.com> --- Created attachment 42080 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42080&action=edit Bug 14620 - Contact information validations I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. Test plan: 1. Apply the patches (and run updatedatabase.pl). 2. Set system preferences ValidateEmailAddress to "Enable" and ValidatePhoneNumber to "International Phone Numbers". 3. Make sure JavaScript is enabled. 4. Navigate to edit user contact informations in Staff client and OPAC. 5. Clear email and phone fields. 6. Insert whitespaces to email and phone fields and submit the form. 7. Edit patron. 8. Observe that there are no longer whitespaces in email and phone fields. 9. Insert invalid email (e.g. "invalid") and invalid phone number ("+123invalid") and send the form. 10. Confirm that form will not be submitted and errors will be given. 11. Disable JavaScript. 12. Insert invalid email and invalid phone number 13. Try sending the form again. 14. Confirm that form will be submitted but errors will be given on top of the form. 15. Observe that none of the changes are accepted. 16. Set system preferences ValidateEmailAddress to "Disable" and ValidatePhoneNumber to "none". 17. Repeat step 3-9 but observe that errors will not be given and changes will be submitted and saved. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42080|0 |1 is obsolete| | --- Comment #11 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42107 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42107&action=edit Bug 14620 - Contact information validations -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.tajoli@cineca.it Patch complexity|--- |Large patch --- Comment #12 from Zeno Tajoli <z.tajoli@cineca.it> --- Patch complexity is 'Large' because this change has many architectural connections -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|z.tajoli@cineca.it | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42107|0 |1 is obsolete| | --- Comment #13 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42456 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42456&action=edit Bug 14620 - Contact information validations -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #14 from Marc Véron <veron@veron.ch> --- Created attachment 42462 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42462&action=edit [Signed-off] Bug 14620 - Contact information validations I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. Test plan: 1. Apply the patches (and run updatedatabase.pl). 2. Set system preferences ValidateEmailAddress to "Enable" and ValidatePhoneNumber to "International Phone Numbers". 3. Make sure JavaScript is enabled. 4. Navigate to edit user contact informations in Staff client and OPAC. 5. Clear email and phone fields. 6. Insert whitespaces to email and phone fields and submit the form. 7. Edit patron. 8. Observe that there are no longer whitespaces in email and phone fields. 9. Insert invalid email (e.g. "invalid") and invalid phone number ("+123invalid") and send the form. 10. Confirm that form will not be submitted and errors will be given. 11. Disable JavaScript. 12. Insert invalid email and invalid phone number 13. Try sending the form again. 14. Confirm that form will be submitted but errors will be given on top of the form. 15. Observe that none of the changes are accepted. 16. Set system preferences ValidateEmailAddress to "Disable" and ValidatePhoneNumber to "none". 17. Repeat step 3-9 but observe that errors will not be given and changes will be submitted and saved. Followed test plan. Works as expected. Signed-off-by: Marc Véron <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=14620 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch Attachment #42456|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 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=14620 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Blocked by bug 7174. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #16 from Lari Taskula <larit@student.uef.fi> --- Email::Valid has some issues validating umlauts. While client-side (validate plugin) works fine, server side (Email::Valid) does not allow umlauts (e.g. äöå). Noting this down for future fix. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 --- Comment #17 from Lari Taskula <larit@student.uef.fi> --- Created attachment 44703 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44703&action=edit Bug 14620 - Contact information validations -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42462|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44703|0 |1 is obsolete| | --- Comment #18 from Lari Taskula <larit@student.uef.fi> --- Created attachment 44705 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44705&action=edit Bug 14620 - Contact information validations I'm thinking we should centralize all patron's contact information validators into one module. Currently we only have validations for e-mail addresses, using the Email::Valid module. In our local library we also want to validate phone numbers with a regex that only recognizes phone numbers from my country. So I suggest we create a phone number validation as well, with an option to easily create custom regex for your local use. If a library does not wish to use validations, we should give them an option to turn them off. If more local validators are implemented, we should also give the library an option to select which validator they wish to use. With this method we could implement phone number validators from around the world and add them into our module. Then we would make the validations simply by calling our validator. The validator would know by system preference which one of the implemented phone number validators it should use. Validations should be both client and server side. Test plan: 1. Apply the patches (and run updatedatabase.pl). 2. Set system preferences ValidateEmailAddress to "Enable" and ValidatePhoneNumber to "International Phone Numbers". 3. Make sure JavaScript is enabled. 4. Navigate to edit user contact informations in Staff client and OPAC. 5. Clear email and phone fields. 6. Insert whitespaces to email and phone fields and submit the form. 7. Edit patron. 8. Observe that there are no longer whitespaces in email and phone fields. 9. Insert invalid email (e.g. "invalid") and invalid phone number ("+123invalid") and send the form. 10. Confirm that form will not be submitted and errors will be given. 11. Disable JavaScript. 12. Insert invalid email and invalid phone number 13. Try sending the form again. 14. Confirm that form will be submitted but errors will be given on top of the form. 15. Observe that none of the changes are accepted. 16. Set system preferences ValidateEmailAddress to "Disable" and ValidatePhoneNumber to "none". 17. Repeat step 3-9 but observe that errors will not be given and changes will be submitted and saved. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org