From cf9cb12edf27b1ae44ffad4882aa0756fdf761b4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 23 Feb 2018 13:02:29 -0300 Subject: [PATCH] Bug 20287: Replace ModMember in patrons import Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- Koha/Patrons/Import.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index e9c1f80ddb..1adb32da5c 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -241,12 +241,15 @@ sub import_patrons { } } - unless ( ModMember(%borrower) ) { + my $patron = Koha::Patrons->find( $borrowernumber ); + eval { $patron->set(\%borrower)->store }; + if ( $@ ) { $invalid++; push( @errors, { + # TODO We can raise a better error name => 'lastinvalid', value => $borrower{'surname'} . ' / ' . $borrowernumber } -- 2.39.5