Bug 21009 - Max length of inputs on editing/adding items is broken
Summary: Max length of inputs on editing/adding items is broken
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-27 17:52 UTC by Paul Hoffman
Modified: 2023-03-13 16:06 UTC (History)
7 users (show)

See Also:
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 (4.11 KB, patch)
2018-06-29 17:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21009: Fix max length of inputs on editing/adding items (4.17 KB, patch)
2018-07-06 20:25 UTC, Pierre-Luc Lapointe
Details | Diff | Splinter Review
Bug 21009: Fix max length of inputs on editing/adding items (4.23 KB, patch)
2018-07-07 12:04 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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