From 938ec10a4ae9ae8218e4a0bd88ede3e77b6f8ecd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 31 Oct 2014 06:24:20 -0400 Subject: [PATCH] Bug 8836 [QA Followup] - Allow collection description to be optional Signed-off-by: Owen Leonard Description is no longer made required by the template and an empty description is saved correctly. Signed-off-by: Katrin Fischer --- C4/RotatingCollections.pm | 10 ++++------ .../en/modules/rotating_collections/editCollections.tt | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index b6152a83f7..f2879946ce 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -88,9 +88,8 @@ sub CreateCollection { if ( !$title ) { return ( 0, 1, "NO_TITLE" ); } - if ( !$description ) { - return ( 0, 2, "NO_DESCRIPTION" ); - } + + $description ||= q{}; my $success = 1; @@ -135,12 +134,11 @@ sub UpdateCollection { if ( !$title ) { return ( 0, 2, "NO_TITLE" ); } - if ( !$description ) { - return ( 0, 3, "NO_DESCRIPTION" ); - } my $dbh = C4::Context->dbh; + $description ||= q{}; + my $sth; $sth = $dbh->prepare( "UPDATE collections diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt index 994b6e4ae5..1247e5bb9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt @@ -108,13 +108,11 @@ [% END %]
  • - + [% IF (editColDescription ) %] - - Required + [% ELSE %] - - Required + [% END %]
  • @@ -132,4 +130,4 @@ [% INCLUDE 'tools-menu.inc' %] -[% INCLUDE 'intranet-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5