Bugzilla – Attachment 80835 Details for
Bug 21599
Incorrect decimal value: '' for column 'defaultreplacecost' - Cannot create item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21599: Fix item type creation by defining default values
Bug-21599-Fix-item-type-creation-by-defining-defau.patch (text/plain), 1.75 KB, created by
Martin Renvoize (ashimema)
on 2018-10-18 13:15:02 UTC
(
hide
)
Description:
Bug 21599: Fix item type creation by defining default values
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-18 13:15:02 UTC
Size:
1.75 KB
patch
obsolete
>From 59957162ebc1d224a7bf5bb7c9bb42a3d671f7a9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 18 Oct 2018 08:32:59 -0300 >Subject: [PATCH] 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> >--- > Koha/ItemType.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm >index 3d769a5f91..d2a23b5bdd 100644 >--- a/Koha/ItemType.pm >+++ b/Koha/ItemType.pm >@@ -37,6 +37,18 @@ Koha::ItemType - Koha Item type Object class > > =cut > >+sub store { >+ my ($self) = @_; >+ >+ $self->rentalcharge(undef) if $self->rentalcharge eq ''; >+ $self->defaultreplacecost(undef) if $self->defaultreplacecost eq ''; >+ $self->processfee(undef) if $self->processfee eq ''; >+ $self->notforloan(0) unless $self->notforloan; >+ $self->hideinopac(0) unless $self->hideinopac; >+ >+ return $self->SUPER::store; >+} >+ > =head3 image_location > > =cut >-- >2.19.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21599
:
80805
|
80828
| 80835