Bug 31376 - Input type email in system preferences prevents multiple addresses
Summary: Input type email in system preferences prevents multiple addresses
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 27805
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-16 21:45 UTC by Caroline Cyr La Rose
Modified: 2024-03-05 19:36 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 31376: Attempt to allow comma delimeted list of emails for preferences (3.80 KB, patch)
2023-12-29 09:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-08-16 21:45:05 UTC
Bug 27805 introduced the "email" input type for system preferences which validates the format. 

This validation prevents putting several email addresses separated by commas in system preferences. In the manual, it says you can input several addresses separated by commas in NoticeBcc
https://koha-community.org/manual/21.05/en/html/circulationpreferences.html#noticebcc so it was a need (I also had a client ask me why he couldn't remove one of the three addresses he had in there and save).

Can we adjust the validation?

To test:
1) Go to Administration > Global system preferences
2) Search for NoticeBcc
3) Add multiple email addresses separated by commas
4) Click "Save all circulation preferences"
Validation error: Please enter a valid email address.

See also bug 16786, bug 12802
Comment 1 Caroline Cyr La Rose 2022-08-16 21:47:41 UTC
If it's not possible to adjust the validation, let me know and I'll change the manual so that it doesn't confuse users.
Comment 2 David Cook 2022-08-25 00:45:53 UTC
This isn't something I'm likely to work on, but I was looking at the "email" input type today for other reasons, and I did notice that you can provide a "multiple" attribute to provide a list of comma separated email addresses:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple

Although if you do that, then the "required" attribute doesn't work anymore. That would be OK for system preferences like NoticeBcc but not for other fields (like self-registration or borrower modification).
Comment 3 Martin Renvoize (ashimema) 2023-12-29 09:18:58 UTC
I had a quick go at this, and although I got it to add 'multiple' to the input field, it still fails validation.

I'll post my work in case it helps lead anyone else to the correct solution.
Comment 4 Martin Renvoize (ashimema) 2023-12-29 09:21:01 UTC
Created attachment 160363 [details] [review]
Bug 31376: Attempt to allow comma delimeted list of emails for preferences

This doesn't work in chrome in my testing.. but I'm not entirely sure
why.

I even tried commenting out the jQuery validator lines introduced in bug
8000, but that didn't help either.