From 57af8e368d6c33e1de3f369caf4c5099a219ea75 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 5 Nov 2020 18:26:42 +0000 Subject: [PATCH] Bug 17499: (follow-up) Fix warning Fix warning DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single. Sponsored-by: The National Library of Finland --- Koha/Patron/Message/Preference.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Patron/Message/Preference.pm b/Koha/Patron/Message/Preference.pm index 69d8420256..32fec13cd0 100644 --- a/Koha/Patron/Message/Preference.pm +++ b/Koha/Patron/Message/Preference.pm @@ -394,10 +394,10 @@ sub _set_message_transport_types { $self->_validate_message_transport_types({ message_transport_types => $types }); foreach my $type (@$types) { unless (exists $self->{'_message_transport_types'}->{$type}) { - my $transport = Koha::Patron::Message::Transports->find({ + my $transport = Koha::Patron::Message::Transports->search({ message_attribute_id => $self->message_attribute_id, message_transport_type => $type - }); + })->next; unless ($transport) { Koha::Exceptions::Patron::Message::Preference::NoTransportType->throw( error => 'No transport configured for '.$self->message_name. -- 2.25.1