From 95fd391ae710dd1f04405c534e6738feb846b0d8 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Mon, 13 May 2019 11:29:50 +0200 Subject: [PATCH] Bug 17247: Check if patron is restricted in HoldItem and HoldTitle Test plan: Make sure a restricted patron cannot hold a title or item through ILS-DI. Response from the WebService should be "PatronDebarred". Signed-off-by: Brendan Gallagher Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- C4/ILSDI/Services.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 049ddcf600..fbc77e3398 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -688,6 +688,9 @@ sub HoldTitle { my $patron = Koha::Patrons->find( $borrowernumber ); return { code => 'PatronNotFound' } unless $patron; + # If borrower is debarred return an error code + return { code => 'PatronDebarred' } if $patron->is_debarred; + # Get the biblio record, or return an error code my $biblionumber = $cgi->param('bib_id'); my $biblio = Koha::Biblios->find( $biblionumber ); @@ -773,6 +776,9 @@ sub HoldItem { my $patron = Koha::Patrons->find( $borrowernumber ); return { code => 'PatronNotFound' } unless $patron; + # If borrower is debarred return an error code + return { code => 'PatronDebarred' } if $patron->is_debarred; + # Get the biblio or return an error code my $biblionumber = $cgi->param('bib_id'); my $biblio = Koha::Biblios->find( $biblionumber ); -- 2.39.5