From 8bb7bc44a7056d54ed9b2826866c77908d2a8a3c Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Fri, 31 Oct 2014 06:24:20 -0400
Subject: [PATCH] [SIGNED-OFF] Bug 8836 [QA Followup] - Allow collection
 description to be optional
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Description is no longer made required by the template and an empty
description is saved correctly.
---
 C4/RotatingCollections.pm                          |   10 ++++------
 .../rotating_collections/editCollections.tt        |   10 ++++------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm
index b6152a8..f287994 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 994b6e4..1247e5b 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 %]
                                 </li>
                                 <li>
-                                    <label class="required" for="description">Description: </label>
+                                    <label for="description">Description: </label>
                                     [% IF (editColDescription ) %]
-                                        <input type="text" size="50" name="description" value="[% editColDescription %]" required="required" />
-                                        <span class="required">Required</span>
+                                        <input type="text" size="50" name="description" value="[% editColDescription %]" />
                                     [% ELSE %]
-                                        <input type="text" size="50" name="description" required="required" />
-                                        <span class="required">Required</span>
+                                        <input type="text" size="50" name="description" />
                                     [% END %]
                                 </li>
                             </ol>
@@ -132,4 +130,4 @@
             [% INCLUDE 'tools-menu.inc' %]
         </div>
     </div> <!-- /#bd -->
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]
-- 
1.7.9.5