X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAuth_with_ldap.pm;h=f3c1f7f39dd006298cc25f69e746f5eec8361748;hb=24125d4be39a3b6f19b1b0ae3f51855575a01759;hp=2f2bb27f2e314b819db914080cc1274a67ec6410;hpb=65be03846d064dd6d9e7159550a269a352054b65;p=koha_fer diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index 2f2bb27f2e..f3c1f7f39d 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -169,11 +169,13 @@ sub checkpw_ldap { return 0; # B2, D2 } if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) { - my @types = C4::Members::AttributeTypes::GetAttributeTypes(); - my @attributes = grep{my $key=$_; any{$_ eq $key}@types;} keys %borrower; my $extended_patron_attributes; - @{$extended_patron_attributes} = - map { { code => $_, value => $borrower{$_} } } @attributes; + foreach my $attribute_type ( C4::Members::AttributeTypes::GetAttributeTypes() ) { + my $code = $attribute_type->{code}; + if ( exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { # skip empty values + push @$extended_patron_attributes, { code => $code, value => $borrower{$code} }; + } + } my @errors; #Check before add for (my $i; $i< scalar(@$extended_patron_attributes)-1;$i++) {