From b100fb160971242032eee104b70e7f8fc167f348 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 10 Apr 2019 14:39:40 +0100 Subject: [PATCH] Bug 22461: Clarify and correct the hash reduction There were a couple of bugs in the previous patch which meant it wasn't working as intended. This patch corrects those bugs and simplifies the code a little along the way. Signed-off-by: Martin Renvoize Signed-off-by: Alex Arnaud Signed-off-by: Nick Clemens (cherry picked from commit c9fa30a55b585b3351ece9c3f789fd18d9807fac) Signed-off-by: Martin Renvoize --- C4/Auth_with_ldap.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index f0e18dd81a..be08a8d34e 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -223,11 +223,9 @@ sub checkpw_ldap { } elsif ($config{replicate}) { # A2, C2 my @columns = Koha::Patrons->columns; my $patron = Koha::Patron->new( - map { - grep join( ' ', @columns ) =~ /$_/ - ? ( $_ => $data{$_} ) - : () - } keys %borrower + { + map { defined( $borrower{$_} ) ? ( $_ => $borrower{$_} ) : () } @columns + } )->store; die "Insert of new patron failed" unless $patron; $borrowernumber = $patron->borrowernumber; -- 2.39.5