Browse Source

Bug 16719: Pass through undef rather than empty string in LDAP mapping

Nullable DB fields should be passed null in cases where ldap fields are
empty and not replaced with empty strings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Oliver Behnke 3 years ago
committed by Martin Renvoize
parent
commit
f514a37d88
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 4
      C4/Auth_with_ldap.pm

4
C4/Auth_with_ldap.pm

@ -274,9 +274,9 @@ sub ldap_entry_2_hash {
my $data = $memberhash{ lc($mapping{$key}->{is}) }; # Net::LDAP returns all names in lowercase
$debug and printf STDERR "mapping %20s ==> %-20s (%s)\n", $key, $mapping{$key}->{is}, $data;
unless (defined $data) {
$data = $mapping{$key}->{content} || ''; # default or failsafe ''
$data = $mapping{$key}->{content} || undef;
}
$borrower{$key} = ($data ne '') ? $data : ' ' ;
$borrower{$key} = $data;
}
$borrower{initials} = $memberhash{initials} ||
( substr($borrower{'firstname'},0,1)

Loading…
Cancel
Save