From a2a7c8d5d8199d3899adfcd1c6e98c658b38d6c3 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 10 Jul 2017 01:52:06 +0000 Subject: [PATCH] Bug 15326: [FOLLOW-UP] adding and editing fixes Sorry, did not see the second half of your comment. This patch should fix the adding and editing issues in Comment 16. --- Koha/CmsPages.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/CmsPages.pm b/Koha/CmsPages.pm index fb0ef92..6af9203 100644 --- a/Koha/CmsPages.pm +++ b/Koha/CmsPages.pm @@ -59,14 +59,14 @@ sub add { carp( 'Koha::CmsPages::add() undefined parameter: input' ) unless defined $input; my $data = { - parent => $input->{parent}, - location => $input->{location}, - branchcode => $input->{branchcode}, + parent => $input->{parent} eq '' ? undef : $input->{parent}, + location => $input->{location} eq '' ? undef : $input->{location}, + branchcode => $input->{branchcode} eq '' ? undef : $input->{branchcode}, lang => $input->{lang}, sortorder => $input->{sortorder}, title => $input->{title}, title_link => $input->{title_link}, - publish => $input->{publish}, + publish => $input->{publish} eq 'on' ? 1 : 0, content => $input->{content} }; -- 2.1.4