From 71611bb146fb9154ebe7533bf857c9abfc2aac33 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 1 Jun 2022 10:00:08 +0200 Subject: [PATCH] Bug 30874: 2 more - need more investigation Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- members/memberentry.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 3cb9df80a5..f2b51b7a34 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -430,8 +430,7 @@ elsif ( $borrowernumber ) { 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} ) if $patron_category; + $newdata{'dateexpiry'} = $category->get_expiry_date( $newdata{dateenrolled} ) if $category; } } @@ -791,8 +790,7 @@ if (!defined($data{'dateenrolled'}) or $data{'dateenrolled'} eq ''){ } if ( $op eq 'duplicate' ) { $data{'dateenrolled'} = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); - my $patron_category = Koha::Patron::Categories->find( $data{categorycode} ); - $data{dateexpiry} = $patron_category->get_expiry_date( $data{dateenrolled} ); + $data{dateexpiry} = $category->get_expiry_date( $data{dateenrolled} ); } if (C4::Context->preference('uppercasesurnames')) { $data{'surname'} &&= uc( $data{'surname'} ); -- 2.39.5