From 240e6beee18fa684229039ac23d5e82082632f2e 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 --- 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.37.1