From 58f54cc44653ef868b5995e911ee7f30db0aef9b 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 --- 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( -- 2.39.5