Bug 28495 - Add validation to branchcode upon library creation
Summary: Add validation to branchcode upon library creation
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-01 13:57 UTC by Caroline Cyr La Rose
Modified: 2021-06-11 17:09 UTC (History)
2 users (show)

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


Attachments
Bug 28495: Improve validation of library entry form (6.71 KB, patch)
2021-06-09 11:46 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28495: Improve validation of library entry form (6.76 KB, patch)
2021-06-11 17:09 UTC, Salman Ali
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 2021-06-01 13:57:05 UTC
Since hyphens and trailing spaces can cause issues in the branchcode (see bug 28492), I propose we add a validation to the branchcode when a user creates a new library. I would limit it to letters and numbers only. Is there something else?
Comment 1 Owen Leonard 2021-06-09 11:46:28 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."
Comment 2 Owen Leonard 2021-06-11 11:50:19 UTC
Is this really signed off? It looks like you may have forgotten to attach the signed-off patch.
Comment 3 Salman Ali 2021-06-11 17:09:47 UTC
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>