Bug 17307: Smaller counter-patch
authorMark Tompsett <mtompset@hotmail.com>
Mon, 19 Sep 2016 16:38:43 +0000 (12:38 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Sun, 25 Sep 2016 13:47:31 +0000 (13:47 +0000)
Given that the issue is trying to call a method on something that isn't
an object, because the category code doesn't exist, then why is it
even trying to change the expiry date? A simple postfix if fixes it.

Applied counter-patch by M. Tompsett. All three patron 'Edit' links
mentioned in previous patch's test plan work fine.

Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/memberentry.pl

index 413920b..1b100b0 100755 (executable)
@@ -372,7 +372,7 @@ if ($op eq 'save' || $op eq 'insert'){
 if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){
     unless ($newdata{'dateexpiry'}){
         my $patron_category = Koha::Patron::Categories->find( $newdata{categorycode} );
-        $newdata{'dateexpiry'} = $patron_category->get_expiry_date( $newdata{dateenrolled} );
+        $newdata{'dateexpiry'} = $patron_category->get_expiry_date( $newdata{dateenrolled} ) if $patron_category;
     }
 }