Bugzilla – Attachment 114183 Details for
Bug 27145
Patron deletion via intranet doesn't handle exceptions well
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27145: Wrap delete and move_to_deleted in a transaction
Bug-27145-Wrap-delete-and-movetodeleted-in-a-trans.patch (text/plain), 1.28 KB, created by
Kyle M Hall (khall)
on 2020-12-04 11:56:00 UTC
(
hide
)
Description:
Bug 27145: Wrap delete and move_to_deleted in a transaction
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-12-04 11:56:00 UTC
Size:
1.28 KB
patch
obsolete
>From 346f9424e5f8da74eca43a762b5b9f577c60d00a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 4 Dec 2020 06:55:37 -0500 >Subject: [PATCH] Bug 27145: Wrap delete and move_to_deleted in a transaction > >--- > members/deletemem.pl | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > >diff --git a/members/deletemem.pl b/members/deletemem.pl >index 4b2f091330..b07ff11278 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -128,11 +128,18 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { > session_id => $input->cookie('CGISESSID'), > token => scalar $input->param('csrf_token'), > }); >+ > my $patron = Koha::Patrons->find( $member ); >- $patron->move_to_deleted; >+ > try { >- $patron->delete; >- print $input->redirect("/cgi-bin/koha/members/members-home.pl"); >+ my $schema = Koha::Database->new->schema; >+ $schema->txn_do( >+ sub { >+ $patron->move_to_deleted; >+ $patron->delete; >+ print $input->redirect( "/cgi-bin/koha/members/members-home.pl" ); >+ } >+ ); > } > catch { > if ( $_->isa('Koha::Exceptions::Patron::FailedDeleteAnonymousPatron') ) { >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27145
:
114149
|
114183
|
127545
|
127546
|
127608
|
127609