Bug 25385 - When cataloguing a too long barcode, Koha explodes or silently cuts it at 20 characters
Summary: When cataloguing a too long barcode, Koha explodes or silently cuts it at 20 ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-06 06:18 UTC by Katrin Fischer
Modified: 2020-05-06 13:43 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-05-06 06:18:20 UTC
We don't validate for length in the forms and this can lead to bad errors especially for users new to Koha:

To test:
- Edit any item in your catalog
- Change the barcode to be longer than 20 characters
- Save
- You see en arror message:

DBIx::Class::Storage::DBI::_dbh_execute(): Data too long for column 'barcode' at row 1 at /home/vagrant/kohaclone/Koha/Object.pm line 164
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Comment 1 Katrin Fischer 2020-05-06 06:32:39 UTC
When not using strict, there is no error, the barcode will be silently "cut" to 20 characters.