Bug 11182: remove spurious logged warnings in circulation
authorMark Tompsett <mtompset@hotmail.com>
Fri, 10 Jan 2014 18:07:10 +0000 (13:07 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 29 Apr 2014 17:49:48 +0000 (17:49 +0000)
TEST PLAN
---------
 1) Log into staff client
 2) Click 'Circulation'
 3) Click 'Check out'
 4a) Type a patron name, click 'Submit'
 4b) If necessary, select which one, and click 'Select'
 5) Check the error logs, new warnings
 6) Apply patch
 7) Click 'Circulation'
 8) Click 'Check out'
 9a) Type a patron name, click 'Submit'
 9b) If necessary, select which one, and click 'Select'
10) Check the error logs, no new warnings
11) Click the 'Restrictions' tab
12) Click 'Add manual restriction'
13) Add a dummy restriction
14) Click the 'Restrictions' tab
15) Click 'Remove'
16) Click 'OK'
17) Confirm that no additional error log entries were added
     and adding/deleting restrictions hasn't broken.

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc

index 216bfc3..70f89d3 100755 (executable)
@@ -660,7 +660,7 @@ $amountold =~ s/^.*\$//;    # remove upto the $, if any
 
 my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
 
-if ( $borrower->{'category_type'} eq 'C') {
+if ( $borrowernumber && $borrower->{'category_type'} eq 'C') {
     my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
     my $cnt = scalar(@$catcodes);
     $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
@@ -737,7 +737,7 @@ $template->param(
     relprevissues              => \@relprevissues,
     displayrelissues           => $displayrelissues,
     inprocess         => $inprocess,
-    is_child          => ($borrower->{'category_type'} eq 'C'),
+    is_child          => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
     circview => 1,
     soundon           => C4::Context->preference("SoundOn"),
     fast_cataloging   => $fast_cataloging,
index cea3416..8d6ac33 100644 (file)
@@ -22,7 +22,7 @@
 </script>
 
 <div id="reldebarments">
-    [% IF ( debarments.size < 1 ) %]
+    [% IF ( not debarments.defined || debarments.size < 1 ) %]
         <p>Patron is currently unrestricted.</p>
     [% ELSE %]
         <table>