From 31d683a263c80bf05d343a12c51eeedf413b1612 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 19 Apr 2021 15:59:57 +0100 Subject: [PATCH] Bug 24295: Remove GetTransfers from C4/Search.pm This patch removes the final use of GetTransfers from C4::Search. Test plan 1/ Perform a search that will include results for some items that have transfers of various states assigned to them 2/ Check the results match expectations (before and after applying the patch should look the same) 3/ Signoff --- C4/Search.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index a4fafd1e01..90aba403fa 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1932,7 +1932,14 @@ sub searchResults { # the in transit status count as unavailable for search limiting, # should map transit status to record indexed in Zebra. # - ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); + my $transfer = Koha::Items->find($item->{itemnumber})->get_transfer; + ( $transfertwhen, $transfertfrom, $transfertto ) = + defined($transfer) + ? ( + $transfer->datesent, $transfer->frombranch, + $transfer->tobranch + ) + : ( '', '', '' ); $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); } -- 2.20.1