[Koha-bugs] [Bug 14620] Contact information validations

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 10 15:39:58 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14620

Lari Taskula <larit at student.uef.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #44703|0                           |1
        is obsolete|                            |

--- Comment #18 from Lari Taskula <larit at 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.


More information about the Koha-bugs mailing list