Bug 22461: (follow-up) Use `exists` not `defined`
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 26 Apr 2019 13:35:18 +0000 (14:35 +0100)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 26 Apr 2019 17:51:09 +0000 (17:51 +0000)
Prior to this patch there is a regression in the LDAP replication
functionality such that clearing a field become impossible. This patch
restores that functionality.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Auth_with_ldap.pm

index 589dbcc..6f3b9a3 100644 (file)
@@ -224,7 +224,7 @@ sub checkpw_ldap {
         my @columns = Koha::Patrons->columns;
         my $patron = Koha::Patron->new(
             {
-                map { defined( $borrower{$_} ) ? ( $_ => $borrower{$_} ) : () } @columns
+                map { exists( $borrower{$_} ) ? ( $_ => $borrower{$_} ) : () } @columns
             }
         )->store;
         die "Insert of new patron failed" unless $patron;