Bug 18932 - Validation not being completed on member entry for number fields
Summary: Validation not being completed on member entry for number fields
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-13 01:43 UTC by Aleisha Amohia
Modified: 2018-06-04 20:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18932: Implementing rules for validating number fields for borrower info (5.08 KB, patch)
2017-07-13 04:36 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2017-07-13 01:43:54 UTC
Should only be able to save numbers, but able to save a string that contains letters and symbols.
Comment 1 Aleisha Amohia 2017-07-13 04:36:50 UTC
Created attachment 65013 [details] [review]
Bug 18932: Implementing rules for validating number fields for borrower info

The fields I've added validation for are (in both OPAC and staff
client):
- phone
- secondary phone
- other phone
- fax
- zipcode
- alt address zipcode
- alt address phone
- alt contact zipcode
- alt contact phone
- SMS number (messaging preferences, may have to enable the
EnhancedMessagingPreferences and EnhancedMessagingPreferencesOPAC
sysprefs to see this)

To test:
1) In staff client, add a new patron or edit an existing one. Confirm
that attempting to enter symbols or letters in the above fields prevents
form submission
2) In OPAC, log in and edit your personal details. Confirm that
attempting to enter symbols or letters in the above fields prevents form
submission.
3) Go to your messaging preferences and confirm you can only save
numbers in the SMS number field

Sponsored-by: Catalyst IT
Comment 2 Marc Véron 2017-07-20 10:03:40 UTC
Restriction to numbers only will lead to localization problems.

For ZIP codes / postal codes: Some countries use alphanumeric codes
https://en.wikipedia.org/wiki/Postal_code

For phone numbers: 
It is no longer possible to enter an interntaional number starting with +
https://en.wikipedia.org/wiki/List_of_country_calling_codes

It is no longer possible to enter a formatted number, e.g. in Switzerland we often use
+41 61 123 45 67
where +41 is the country code and 61 the area code
Comment 3 Katrin Fischer 2017-08-10 22:12:40 UTC
I agree with Marc, this kind of very strict validation will probably cause more problems than help. 
We are also used to enter phone numbers with spaces for better readability, which is no longer possible with this patch. If this was implemented, it would cause a lot of errors every time an existing record is edited.
Comment 4 Aleisha Amohia 2017-08-11 00:44:20 UTC
Both fair comments, I did not think of those cases. I'll set this to Resolved - thanks for your input!
Comment 5 Katrin Fischer 2017-08-11 08:34:37 UTC
Aleisha++
Comment 6 Marc Véron 2017-08-11 09:44:00 UTC
(In reply to Katrin Fischer from comment #5)
> Aleisha++

+1  :-)