Bug 21599: Fix item type creation by defining default values
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 18 Oct 2018 11:32:59 +0000 (08:32 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 5 Nov 2018 12:23:26 +0000 (12:23 +0000)
commit6c2eeaa43443e0591eebbf00f48dacfff005b647
treea06a23556c8741b0252d2d004c75ebd7b7dca7e5
parent286b453d3a41ed186ac44ac339319f934e2fb0eb
Bug 21599: Fix item type creation by defining default values

Same as what we have in Koha::Patron->new, empty strings should not be
inserted in integer or date column type

DBD::mysql::st execute failed: Incorrect decimal value: '' for column 'defaultreplacecost' at row 1 [for Statement "INSERT INTO `itemtypes` ( `checkinmsg`, `checkinmsgtype`, `defaultreplacecost`, `description`, `hideinopac`, `imageurl`, `itemtype`, `notforloan`, `processfee`, `rentalcharge`, `searchcategory`, `sip_media_type`, `summary`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="", 1="message", 2="", 3="xx", 4=0, 5='', 6="XX", 7=0, 8="", 9="", 10="", 11=undef, 12=""] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.

Test plan:
Create a new itemtype

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 33c142ba3b7cfd37dd90569de2a5802849b09ef5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/ItemType.pm