Bug 40497

Summary: Item add form does not respect framework maxlength setting
Product: Koha Reporter: Owen Leonard <oleonard>
Component: CatalogingAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: m.de.rooy, nick
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 40508    
Attachments: Bug 40497: Item add form does not respect framework maxlength setting
Bug 40497: Item add form does not respect framework maxlength setting
Bug 40497: Item add form does not respect framework maxlength setting

Description Owen Leonard 2025-07-24 15:57:54 UTC
The item add form uses the wrong template variable to set the maxlength attribute on a text input field.
Comment 1 Owen Leonard 2025-07-24 16:25:47 UTC
Created attachment 184598 [details] [review]
Bug 40497: Item add form does not respect framework maxlength setting

This patch corrects the template variable which populates the maxlenth
attribute on text fields in the add/edit item form.

To test, apply the patch and go Administratoin -> MARC bibliographic
frameworks -> (framework) -> Tag 952 -> Edit subfields.

- Click the "p" tab and set the "Max length" field to "20"
- Save the framework and go to Cataloging.
- Locate a bibliographic record that uses the framework you edited.
- Add or edit an item on that bibliographic record.
- Check the "Barcode" field. The input tag should limit your entry to 20
  characters.

Sponsored-by: Athens County Public Libraries
Comment 2 David Nind 2025-07-29 04:37:17 UTC
Created attachment 184776 [details] [review]
Bug 40497: Item add form does not respect framework maxlength setting

This patch corrects the template variable which populates the maxlenth
attribute on text fields in the add/edit item form.

To test, apply the patch and go Administratoin -> MARC bibliographic
frameworks -> (framework) -> Tag 952 -> Edit subfields.

- Click the "p" tab and set the "Max length" field to "20"
- Save the framework and go to Cataloging.
- Locate a bibliographic record that uses the framework you edited.
- Add or edit an item on that bibliographic record.
- Check the "Barcode" field. The input tag should limit your entry to 20
  characters.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Nick Clemens (kidclamp) 2025-08-01 13:46:44 UTC
I cannot recreate the issue before the patch, if I alter the maxlength of a field it is respected
Comment 4 Marcel de Rooy 2025-08-29 09:56:04 UTC
Created attachment 185894 [details] [review]
Bug 40497: Item add form does not respect framework maxlength setting

This patch corrects the template variable which populates the maxlenth
attribute on text fields in the add/edit item form.

To test, apply the patch and go Administratoin -> MARC bibliographic
frameworks -> (framework) -> Tag 952 -> Edit subfields.

- Click the "p" tab and set the "Max length" field to "20"
- Save the framework and go to Cataloging.
- Locate a bibliographic record that uses the framework you edited.
- Add or edit an item on that bibliographic record.
- Check the "Barcode" field. The input tag should limit your entry to 20
  characters.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Lucas Gass (lukeg) 2025-08-29 17:10:13 UTC
Nice work everyone!

Pushed to main for 25.11