@@ -, +, @@ --- C4/Auth_with_ldap.pm | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) --- a/C4/Auth_with_ldap.pm +++ a/C4/Auth_with_ldap.pm @@ -233,21 +233,17 @@ sub checkpw_ldap { if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) { my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id); - while ( my $attribute_type = $attribute_types->next ) { - my $code = $attribute_type->code; - unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { - next; - } - my $patron = Koha::Patrons->find($borrowernumber); - if ( $patron ) { # Should not be needed, but we are in C4::Auth LDAP... - eval { - my $attribute = Koha::Patron::Attribute->new({code => $code, attribute => $borrower{$code}}); - $patron->extended_attributes([$attribute->unblessed]); - }; - if ($@) { # FIXME Test if Koha::Exceptions::Patron::Attribute::NonRepeatable - warn "ERROR_extended_unique_id_failed $code $borrower{$code}"; + my $patron = Koha::Patrons->find($borrowernumber); + if ( $patron ) { + my @attributes; + while ( my $attribute_type = $attribute_types->next ) { + my $code = $attribute_type->code; + unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { + next; } + push @attributes, { code => $code, attribute => $borrower{$code} }; } + $patron->extended_attributes(\@attributes); } } return(1, $cardnumber, $userid); --