Bug 20443: Fix creation of new patron with attributes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-03-04 15:44:42 +01:00 committed by Martin Renvoize
parent 8bcfd1c211
commit fc430529c1
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 2 deletions

View File

@ -436,7 +436,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
if ($op eq 'insert'){
# we know it's not a duplicate borrowernumber or there would already be an error
delete $newdata{password2};
my $patron = eval { Koha::Patron->new(\%newdata)->store };
$patron = eval { Koha::Patron->new(\%newdata)->store };
if ( $@ ) {
# FIXME Urgent error handling here, we cannot fail without relevant feedback
# Lot of code will need to be removed from this script to handle exceptions raised by Koha::Patron->store
@ -532,7 +532,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
delete $newdata{'userid'};
}
my $patron = Koha::Patrons->find( $borrowernumber );
$patron = Koha::Patrons->find( $borrowernumber );
$newdata{debarredcomment} = $newdata{debarred_comment};
delete $newdata{debarred_comment};
delete $newdata{password2};