[Koha-patches] [PATCH] Bug 4995 - extended attributes replication from LDAP

Dobrica Pavlinusic dpavlin at rot13.org
Tue Jul 13 23:43:44 CEST 2010


---
 C4/Auth_with_ldap.pm |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm
index b25697c..d3f8333 100644
--- a/C4/Auth_with_ldap.pm
+++ b/C4/Auth_with_ldap.pm
@@ -164,9 +164,8 @@ sub checkpw_ldap {
     }
 	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 = map{{code=>$_,value=>$borrower{$_}}}@attributes;
-		my $extended_patron_attributes = [] unless $extended_patron_attributes;
+		my @attributes = grep{my $key=$_; any{$_->{code} eq $key}@types;} keys %borrower;
+		my $extended_patron_attributes = [ map{{code=>$_,value=>$borrower{$_}}}@attributes ];
 		my @errors;
 		#Check before add
 		for (my $i; $i< scalar(@$extended_patron_attributes)-1;$i++) {
-- 
1.5.6.5



More information about the Koha-patches mailing list