From c604e2d02a6ed4289fdaadce8fa118e670aa5856 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 --- Koha/Patron.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index e2eab4643a8..4e1bda23d41 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -2501,8 +2501,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.30.2