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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-10-25 14:41:56 +00:00 committed by Katrin Fischer
parent e567f78e27
commit 4c1e6b5e71
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 0 deletions

View File

@ -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(