From eccf1fa5eb5873c12fe91f29f77f51eab0fb9b44 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 28 Apr 2014 18:08:58 +0000 Subject: [PATCH] Bug 11351: (follow-up) ensure itemtypes.sip_media_type is set to NULL when cleared This patch ensures that the sip_media_type is set to NULL rather than the empty string when it is cleared via item types administration. Signed-off-by: Galen Charlton --- admin/itemtypes.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index df91e7bdf2..87af801ce9 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -91,6 +91,9 @@ if ($op) { my $dbh = C4::Context->dbh; +my $sip_media_type = $input->param('sip_media_type'); +undef($sip_media_type) if defined($sip_media_type) and $sip_media_type =~ /^\s*$/; + ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record if ( $op eq 'add_form' ) { @@ -164,7 +167,7 @@ elsif ( $op eq 'add_validate' ) { $input->param('summary'), $input->param('checkinmsg'), $input->param('checkinmsgtype'), - $input->param('sip_media_type'), + $sip_media_type, $input->param('itemtype') ); } @@ -188,7 +191,7 @@ elsif ( $op eq 'add_validate' ) { $input->param('summary'), $input->param('checkinmsg'), $input->param('checkinmsgtype'), - $input->param('sip_media_type'), + $sip_media_type, ); } -- 2.39.5