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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 4 16:34:26 CEST 2017


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

Lari Taskula <lari.taskula at jns.fi> changed:

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

--- Comment #19 from Lari Taskula <lari.taskula at jns.fi> ---
Created attachment 61843
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61843&action=edit
Bug 14620: Contact information validations

This patch adds a phone number validation by regex and centralizes
different validation methods into Koha::Validation class.

Introduces a new system preference, ValidatePhoneNumber, that takes a
regular expression and uses it to validate phone numbers both client
and server side.

Unit tests to test:
1. prove t/db_dependent/Koha/Validation.t

To test:
1. Apply the patches and run updatedatabase.pl to install the new
   system preference
2. Set system preference ValidatePhoneNumber to any regex you like
   (there is an example in the description of the preference)
3. Navigate to edit user contact informations in Staff client and OPAC.
4. Insert invalid email (e.g. "invalid") and invalid phone number
("+123invalid")
   and send the form.
5. Confirm that form will not be submitted and errors will be given.
6. Disable JavaScript and test that these errors will also be provided by the
   server.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list