Bugzilla – Attachment 53055 Details for
Bug 16819
C4::Members::DelMember should use Koha::Holds to delete holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds
Bug-16819-C4MembersDelMember-should-use-KohaHolds-.patch (text/plain), 1.94 KB, created by
Jonathan Druart
on 2016-07-03 15:00:00 UTC
(
hide
)
Description:
Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-03 15:00:00 UTC
Size:
1.94 KB
patch
obsolete
>From a1e4d4f8f2ed8c7efd2f1a4b2501317ce1c683f5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 28 Jun 2016 10:18:48 -0300 >Subject: [PATCH] Bug 16819: C4::Members::DelMember should use Koha::Holds to > delete holds > >This patch makes C4::Members::DelMember proprely use Koha::Holds to delete >holds. This is important as holds actions are started to be logged. > >To reproduce: >- Apply the patch >- Run: > $ prove t/db_dependent/Members.t >=> SUCCESS: Tests pass >- Sign off :-D > >Sponsored-by: NEKLS >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >All tests pass successfully > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Members.pm | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 383799d..4ca2f91 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -41,6 +41,7 @@ use Koha::Patron::Debarments qw(IsDebarred); > use Text::Unaccent qw( unac_string ); > use Koha::AuthUtils qw(hash_password); > use Koha::Database; >+use Koha::Holds; > use Koha::List::Patron; > > our (@ISA,@EXPORT,@EXPORT_OK,$debug); >@@ -1660,18 +1661,16 @@ sub DelMember { > my $borrowernumber = shift; > #warn "in delmember with $borrowernumber"; > return unless $borrowernumber; # borrowernumber is mandatory. >+ # Delete Patron's holds >+ my @holds = Koha::Holds->search({ borrowernumber => $borrowernumber }); >+ map { $_->delete } @holds; > >- my $query = qq|DELETE >- FROM reserves >- WHERE borrowernumber=?|; >- my $sth = $dbh->prepare($query); >- $sth->execute($borrowernumber); >- $query = " >+ my $query = " > DELETE > FROM borrowers > WHERE borrowernumber = ? > "; >- $sth = $dbh->prepare($query); >+ my $sth = $dbh->prepare($query); > $sth->execute($borrowernumber); > logaction("MEMBERS", "DELETE", $borrowernumber, "") if C4::Context->preference("BorrowersLog"); > return $sth->rows; >-- >2.8.1
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 16819
:
52929
|
52930
|
53030
|
53031
|
53054
| 53055 |
53056