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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 12 15:08:14 CEST 2015


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

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


More information about the Koha-bugs mailing list