Bug 14445: Silences warn in letter.pl
authorAleisha <aleishaamohia@hotmail.com>
Wed, 24 Jun 2015 01:15:32 +0000 (01:15 +0000)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Mon, 20 Jul 2015 13:33:09 +0000 (10:33 -0300)
When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn.

To test:
1) Go to Tools, the Notices & Slips
2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch)
3) Change Koha module to 'Circulation'
4) Notice warn about uninitialized $code variable
5) Apply patch and reload page, change Koha module to 'Circulation'
6) Notice page still works and warns are gone

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
tools/letter.pl

index ca9f0ce..8ef07be 100755 (executable)
@@ -227,7 +227,7 @@ sub add_form {
 
         }
 
-        if ( $module eq 'circulation' && $code eq "CHECKIN" ) {
+        if ( $module eq 'circulation' and $code and $code eq "CHECKIN" ) {
             push @{$field_selection}, add_fields('old_issues');
         } else {
             push @{$field_selection}, add_fields('issues');