Bug 21009: Fix max length of inputs on editing/adding items
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 29 Jun 2018 17:09:07 +0000 (14:09 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 30 Jul 2018 12:09:15 +0000 (14:09 +0200)
commited2cf32df97a75fe462a26dc6b72ce0b6f3e2db0
tree1729edcfa909c9433feadad979fe8a151accaa39
parent4d5e9c7833a9ebd1b32c210e45016ff37cd6f775
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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 73e9c077f6543a4b08f3d2e7394c1e667f0d24e5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
cataloguing/additem.pl