Bug 28704 - Library MARCOrgCode field needs maxlength attribute
Summary: Library MARCOrgCode field needs maxlength attribute
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Nick Clemens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-13 10:54 UTC by Owen Leonard
Modified: 2022-06-06 20:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an error that occurs when you enter a "MARC organization code" in the form for adding and editing libraries. With this change the input field is limited to 16 characters.
Version(s) released in:
21.11.00,21.05.03,20.11.09


Attachments
Bug 28704: Library MARCOrgCode field needs maxlength attribute (1.95 KB, patch)
2021-07-13 11:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28704: Library MARCOrgCode field needs maxlength attribute (2.00 KB, patch)
2021-07-29 20:02 UTC, David Nind
Details | Diff | Splinter Review
Bug 28704: Library MARCOrgCode field needs maxlength attribute (2.05 KB, patch)
2021-07-30 11:06 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-07-13 10:54:37 UTC
When adding or editing a library, the "MARC organization code" field should be limited to the maximum length defined in the table, which is 16. Otherwise the process will fail with an unhelpful message, "An error occurred when adding this library. The branchcode might already exist."
Comment 1 Owen Leonard 2021-07-13 11:21:16 UTC
Created attachment 122800 [details] [review]
Bug 28704: Library MARCOrgCode field needs maxlength attribute

This patch adds a maxlength attribute to the "MARC organization code"
field in the form for adding and editing libraries. The maxlength, 16,
matches the limit of the table column.

To reproduce the problem, go to Administration -> Libraries.
 - Add or edit a library
 - Fill the "MARC organization code" field with a string longer than 16
   characters, e.g. Decriminalization
 - When you save the record you will see an error.

Apply the patch and add or edit a library.
 - Confirm that you cannot enter more than 16 characters in the "MARC
   organization code" field.
Comment 2 David Nind 2021-07-29 20:02:50 UTC
Created attachment 123288 [details] [review]
Bug 28704: Library MARCOrgCode field needs maxlength attribute

This patch adds a maxlength attribute to the "MARC organization code"
field in the form for adding and editing libraries. The maxlength, 16,
matches the limit of the table column.

To reproduce the problem, go to Administration -> Libraries.
 - Add or edit a library
 - Fill the "MARC organization code" field with a string longer than 16
   characters, e.g. Decriminalization
 - When you save the record you will see an error.

Apply the patch and add or edit a library.
 - Confirm that you cannot enter more than 16 characters in the "MARC
   organization code" field.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Nick Clemens 2021-07-30 11:06:13 UTC
Created attachment 123298 [details] [review]
Bug 28704: Library MARCOrgCode field needs maxlength attribute

This patch adds a maxlength attribute to the "MARC organization code"
field in the form for adding and editing libraries. The maxlength, 16,
matches the limit of the table column.

To reproduce the problem, go to Administration -> Libraries.
 - Add or edit a library
 - Fill the "MARC organization code" field with a string longer than 16
   characters, e.g. Decriminalization
 - When you save the record you will see an error.

Apply the patch and add or edit a library.
 - Confirm that you cannot enter more than 16 characters in the "MARC
   organization code" field.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Jonathan Druart 2021-07-30 14:02:41 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-08-06 13:40:33 UTC
Pushed to 21.05.x for 21.05.03
Comment 6 Fridolin Somers 2021-08-11 19:51:16 UTC
Pushed to 20.11.x for 20.11.09
Comment 7 Victor Grousset/tuxayo 2021-08-16 20:27:54 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.