From 4fff2cf9826d1294b137d07cdf7fc422437f02a2 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 25 Oct 2024 14:41:56 +0000 Subject: [PATCH] Bug 36822: LDAP - Add discard_changes Test plan: 1) Apply only LDAP rearrangement patch 2) Run that test file (to prove the rearrangement does not break tests): $ prove t/db_dependent/Auth_with_ldap.t 3) Verify tests pass 4) Apply LDAP test patch on top 5) Run the test file. Notice it fails. 6) Apply this patch. Run LDAP tests again. Verify tests pass. Co-authored-by: Martin Renvoize Signed-off-by: David Nind Signed-off-by: Katrin Fischer (cherry picked from commit 4c1e6b5e71e1fd033de8b289d0693edca7d28d01) Signed-off-by: Lucas Gass (cherry picked from commit bc5556acd3cec9d405b4b845c8a68e0f20a5adf2) Signed-off-by: Fridolin Somers --- C4/Auth_with_ldap.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index f0993c89ba..406e0d9a19 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -227,6 +227,7 @@ sub checkpw_ldap { map { exists( $borrower{$_} ) ? ( $_ => $borrower{$_} ) : () } @columns } )->store; + $patron->discard_changes; die "Insert of new patron failed" unless $patron; $borrowernumber = $patron->borrowernumber; C4::Members::Messaging::SetMessagingPreferencesFromDefaults(