From e576c48ebc29ed46ac3c4b4a8f1b6907326f4c61 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Mar 2019 06:55:35 +0000 Subject: [PATCH] Bug 22577: Prevent system users from returning in searches --- Koha/Patrons.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index dedf4c4a65..e3e914b1fc 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -208,6 +208,20 @@ sub anonymise_issue_history { return $nb_rows; } +=head3 search + + Koha::Patrons->search(); + +Ensure patron searches do not return internal system users + +=cut + +sub search { + my ( $self, $params, $attr ) = @_; + return $self->SUPER::search( { borrowernumber => { '>' => 0 } } ) + ->SUPER::search( $params, $attr ); +} + =head3 delete Koha::Patrons->search({ some filters here })->delete({ move => 1 }); -- 2.20.1