From 49f90722ee7a962dba39c96c77461e1970b3b9ba Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 24 Jul 2025 16:11:24 +0000 Subject: [PATCH] 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 --- .../prog/en/includes/html_helpers.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index 214b29cf401..81a5d33da79 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -99,7 +99,7 @@ [% SET mv = subfield.marc_value %] [% IF ( mv.type == 'hidden' ) %] - + [% ELSIF ( mv.type == 'select' ) %] [% SET select_readonly = '' %] [% SET select_disabled = '' %] @@ -152,12 +152,12 @@ id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" - maxlength="[%- mv.maxlength | html -%]" + maxlength="[%- subfield.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> [% ELSE %] - + [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] ... [% END %] @@ -168,7 +168,7 @@ id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" - maxlength="[%- mv.maxlength | html -%]" + maxlength="[%- subfield.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> @@ -178,7 +178,7 @@ id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor framework_plugin [% kohafield | html %]" - maxlength="[%- mv.maxlength | html -%]" + maxlength="[%- subfield.maxlength | html -%]" value="[%- mv.value | html -%]" data-plugin="[% mv.plugin | html %]" /> @@ -199,12 +199,12 @@ id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" - maxlength="[%- mv.maxlength | html -%]" + maxlength="[%- subfield.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> [% ELSE %] - + [% END %] [% ELSIF ( mv.type == 'textarea' ) %] [% IF mv.readonly %] -- 2.39.5