Bugzilla – Attachment 98573 Details for
Bug 16719
LDAP: Using empty strings as 'failsafe' attribute mapping defeats database constraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16719: Pass through undef rather than empty string in LDAP mapping
Bug-16719-Pass-through-undef-rather-than-empty-str.patch (text/plain), 1.26 KB, created by
Nick Clemens (kidclamp)
on 2020-02-07 16:56:58 UTC
(
hide
)
Description:
Bug 16719: Pass through undef rather than empty string in LDAP mapping
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-02-07 16:56:58 UTC
Size:
1.26 KB
patch
obsolete
>From ef8339c17319037a6b4d6b2defe479fc08bd3aba Mon Sep 17 00:00:00 2001 >From: Oliver Behnke <oliver.behnke@aei.mpg.de> >Date: Fri, 7 Feb 2020 12:31:31 +0000 >Subject: [PATCH] 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> >--- > C4/Auth_with_ldap.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index e861800c76..3981c9b8d4 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/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) >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16719
:
52316
|
53124
|
98560
|
98561
| 98573 |
98574
|
98575