Bug 21009

Summary: Max length of inputs on editing/adding items is broken
Product: Koha Reporter: Paul Hoffman <paul>
Component: CatalogingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer, m.de.rooy, martin.renvoize, nick, pierre-luc.lapointe
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20882
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33212
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 21009: Fix max length of inputs on editing/adding items
Bug 21009: Fix max length of inputs on editing/adding items
Bug 21009: Fix max length of inputs on editing/adding items

Comment 1 Jonathan Druart 2018-06-29 17:08:16 UTC
I do not know if I am going to address you concern here but I found a bug.

There is a "max length" value you can defined at framework level, to limit the size of the input. But it is not taken into account on the add/edit item form.

It is a regression that has been introduced by
  commit 47d2de9c024bfb93d56184f298f334b20685cd86
  Bug 12176: Remove HTML from additem.pl
Comment 2 Jonathan Druart 2018-06-29 17:12:58 UTC
Created attachment 76578 [details] [review]
Bug 21009: Fix max length of inputs on editing/adding items

There is a "max length" value you can define at framework level to
limit the size of the input. But it is not taken into account on the
add/edit item form.

It is a regression that has been introduced by
  commit 47d2de9c024bfb93d56184f298f334b20685cd86
  Bug 12176: Remove HTML from additem.pl

max_length vs maxlength

Test plan:
- Define a maximum length for an item subfield
- Add or edit an item
=> Without this patch the maxlength attribute of the inputs are not
defined (maxlength="")
=> With this fix you will see the maxlength attributes correctly set
with the value you defined in the framework

Note:
We could/should set this value to the size of the DB column when mapped
For instance 952$u is mapped with items.uri, which is a varchar(255).
This length restriction should done at framework level
Comment 3 Pierre-Luc Lapointe 2018-07-06 20:25:39 UTC
Created attachment 76749 [details] [review]
Bug 21009: Fix max length of inputs on editing/adding items

There is a "max length" value you can define at framework level to
limit the size of the input. But it is not taken into account on the
add/edit item form.

It is a regression that has been introduced by
  commit 47d2de9c024bfb93d56184f298f334b20685cd86
  Bug 12176: Remove HTML from additem.pl

max_length vs maxlength

Test plan:
- Define a maximum length for an item subfield
- Add or edit an item
=> Without this patch the maxlength attribute of the inputs are not
defined (maxlength="")
=> With this fix you will see the maxlength attributes correctly set
with the value you defined in the framework

Note:
We could/should set this value to the size of the DB column when mapped
For instance 952$u is mapped with items.uri, which is a varchar(255).
This length restriction should done at framework level

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Comment 4 Katrin Fischer 2018-07-07 12:04:15 UTC
Created attachment 76751 [details] [review]
Bug 21009: Fix max length of inputs on editing/adding items

There is a "max length" value you can define at framework level to
limit the size of the input. But it is not taken into account on the
add/edit item form.

It is a regression that has been introduced by
  commit 47d2de9c024bfb93d56184f298f334b20685cd86
  Bug 12176: Remove HTML from additem.pl

max_length vs maxlength

Test plan:
- Define a maximum length for an item subfield
- Add or edit an item
=> Without this patch the maxlength attribute of the inputs are not
defined (maxlength="")
=> With this fix you will see the maxlength attributes correctly set
with the value you defined in the framework

Note:
We could/should set this value to the size of the DB column when mapped
For instance 952$u is mapped with items.uri, which is a varchar(255).
This length restriction should done at framework level

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2018-07-13 11:26:37 UTC
Awesome work all!

Pushed to master for 18.11
Comment 6 Martin Renvoize 2018-07-15 18:45:33 UTC
Pushed to 18.05.x for 18.05.02
Comment 7 Fridolin Somers 2018-07-30 12:12:17 UTC
Pushed to 17.11.x for 17.11.09