Summary: | Add validation to branchcode upon library creation | ||
---|---|---|---|
Product: | Koha | Reporter: | Caroline Cyr La Rose <caroline.cyr-la-rose> |
Component: | System Administration | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Nick Clemens (kidclamp) <nick> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, eric.begin, gmcharlt, jonathan.druart, nick, philippe.blouin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 28495: Improve validation of library entry form
Bug 28495: Improve validation of library entry form Bug 28495: (QA follow-up) Enable the use of underscores in branch codes Bug 28495: Improve validation of library entry form Bug 28495: (QA follow-up) Enable the use of underscores in branch codes |
Description
Caroline Cyr La Rose
2021-06-01 13:57:05 UTC
Created attachment 121737 [details] [review] Bug 28495: Improve validation of library entry form This patch adds validation of the "Library code" field so that entry is limited to letters and numbers. Also changed: Updated the email fields to add the "email" type attribute (see also Bug 27805). To test, apply the patch and go to Administration -> Libraries -> New library. - Try entering various strings in the "Library code" field. If you enter anything other than letters and numbers an error message should be displaed on blur or on submit. - Try submitting the form with no data in the "Library code" and/or "Name" field. The fields should be required. - Test entering various strings in the email-type fields: Email, Ill staff email, Reply-To, and Return-Path. Non-email entries should trigger a message, "Please enter a valid email address." Is this really signed off? It looks like you may have forgotten to attach the signed-off patch. Created attachment 121867 [details] [review] Bug 28495: Improve validation of library entry form This patch adds validation of the "Library code" field so that entry is limited to letters and numbers. Also changed: Updated the email fields to add the "email" type attribute (see also Bug 27805). To test, apply the patch and go to Administration -> Libraries -> New library. - Try entering various strings in the "Library code" field. If you enter anything other than letters and numbers an error message should be displaed on blur or on submit. - Try submitting the form with no data in the "Library code" and/or "Name" field. The fields should be required. - Test entering various strings in the email-type fields: Email, Ill staff email, Reply-To, and Return-Path. Non-email entries should trigger a message, "Please enter a valid email address." Signed-off-by: Salman Ali <salman@outaouais> Underscores? I know we have many libraries that have these in existing libraries and may want to continue with their naming pattern. I like preventing problems, but am we can limit this far Created attachment 123318 [details] [review] Bug 28495: (QA follow-up) Enable the use of underscores in branch codes This patch adds underscores to the list of valid characters in the branch code field. Created attachment 123332 [details] [review] Bug 28495: Improve validation of library entry form This patch adds validation of the "Library code" field so that entry is limited to letters and numbers. Also changed: Updated the email fields to add the "email" type attribute (see also Bug 27805). To test, apply the patch and go to Administration -> Libraries -> New library. - Try entering various strings in the "Library code" field. If you enter anything other than letters and numbers an error message should be displaed on blur or on submit. - Try submitting the form with no data in the "Library code" and/or "Name" field. The fields should be required. - Test entering various strings in the email-type fields: Email, Ill staff email, Reply-To, and Return-Path. Non-email entries should trigger a message, "Please enter a valid email address." Signed-off-by: Salman Ali <salman.ali@inLibro.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 123333 [details] [review] Bug 28495: (QA follow-up) Enable the use of underscores in branch codes This patch adds underscores to the list of valid characters in the branch code field. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> We cannot edit existing branchcodes, so should nto cause issues for previously entered names, and prevents issues with new ones Why this limitation? I would exclude a list of special characters but not to anything that is not a-Z0-9, "❤" is a valid branchcode and is known (by me, at least) to work perfectly. It will certainly be considered as a regression by users not using Latin alphabet. The initial issue was with search here. If you have A-B and A as branch codes, limiting to A will also bring up A-B. Could be adding a hint that using _ space and - might lead to unexpected search results an alternative? That said, there _IS_ validation on the branchcode in the onboarding tool that is not reflected in the normal GUI - so instead of adding validation here, we could remove it there and add hints in both spots. Some variation of this issue poped up again, this time with categories. Rereading the comments from the QAs, I see a resistance to putting restrictions on the branchcode (or other auth values, as well), but I see no trace of a solution. Underscores, hyphens, trailing spaces are breaking the search, and it's ok ? I don't see why Koha should accept *everything* for a CODE(!!). Yeah, we want the description to be flexible, in any language, but I don't get it for the code. We don't have to be uberrestrictive, but at least known problems should be avoided. |