From 73739dd0b6458faca14c14f7c0dd950f89a686e3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 21 Jul 2023 12:56:51 +0000 Subject: [PATCH] Bug 28130: (QA follow-up) Use schema result to fetch alerts to allow for prefetch Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/Patron.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 93fac36d09..9794b14b1f 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -2710,8 +2710,7 @@ Return a Koha::Subscriptions object containing subscriptions for which the patro sub alert_subscriptions { my ( $self ) = @_; - my $schema = Koha::Database->new->schema; - my @alerts = $schema->resultset('Alert')->search({ borrowernumber => $self->borrowernumber }); + my @alerts = $self->_result->alerts; my @subscription_ids = map { $_->externalid } @alerts; return Koha::Subscriptions->search({ subscriptionid => \@subscription_ids }); -- 2.39.5