[Koha-bugs] [Bug 23817] Normalize phone number when searching patrons

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 14 21:21:12 CEST 2022


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

David Nind <david at davidnind.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david at davidnind.com

--- Comment #14 from David Nind <david at davidnind.com> ---
I've tested this, and it works as per the test plan.

While this works, and I probably don't appreciate the effort required to get
searching the phone number to work -- I have some feedback.

I'm not a fan of displaying the phone number as a number without any
formatting, such as +, dashes, spaces, and brackets:
- Usability: They are hard to read or verify by a human
- They are displayed on transit slips (see note on the patron edit form), I
think it makes it harder to read phone numbers if they are displayed as a
string of numbers without formatting
- It doesn't follow best practices for web forms

Some ideas (but not how to code):

1. Validate the input of phone numbers, so they are entered without inputting
+, dashes, spaces, brackets, etc - see this article:
https://uxplanet.org/phone-number-field-design-best-practices-23957cbd86d5

2. Number stored as just a number without any formatting

3. Displayed for patron according to a format display setting (as an aside,
this would work going forward, but not with existing numbers if they have been
entered inconsistently)

4. As long as the number is stored without formatting, then any characters such
as brackets, spaces, dashes, +, etc could be removed by JavaScript when
inputting in the search box.

I couldn't find an "authoritative" article about phone number and web form
input, validation and display - but I didn't look very hard:
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel
- Maybe there is a well supported JavaScript library for resolving this, such
as https://github.com/google/libphonenumber

I'm sure there is a trade-off between being able to search (how the number is
stored), vs how the number is displayed. 

Maybe sorting out the input of phone numbers as a separate bug would then make
solving the search problem easier....

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


More information about the Koha-bugs mailing list