Bug 8836 [QA Followup] - Allow collection description to be optional
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 31 Oct 2014 10:24:20 +0000 (06:24 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 6 Nov 2014 18:12:19 +0000 (15:12 -0300)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Description is no longer made required by the template and an empty
description is saved correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
C4/RotatingCollections.pm
koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt

index b6152a8..f287994 100644 (file)
@@ -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
index 994b6e4..1247e5b 100644 (file)
                                     [% 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>
             [% INCLUDE 'tools-menu.inc' %]
         </div>
     </div> <!-- /#bd -->
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]