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)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 12 Jul 2018 12:57:25 +0000 (12:57 +0000)
commit2414a4e7056656843696aca19a75acebb577745a
tree3b39db7cf20cbe765c738e697e581acf0be1de6d
parent82e0e97a0081ce75c334ca3073d385e53f21d51c
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>
cataloguing/additem.pl