From feea30d42bdce19cee6c7f2f7b89dbd4a51bf810 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 2 Feb 2023 17:55:10 +0000 Subject: [PATCH] Bug 28641: ILLHiddenRequestStatuses does not consider custom statuses This patch adds the status_alias column to the ILLHiddenRequestStatuses sys pref check. Because requests will have status_alias NULL by default, we also check for that. Test plan: Create multiple ILL requests of different backends and place them in different status (NEW, COMP, REQ, etc) Create multiple ILLSTATUS entries Add and remove a mix of both status and status_alias codes in ILLHiddenRequestStatuses and refresh the ILL requests page to confirm the result is according to expectation. Sponsored-by: PTFS Europe Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit aaa5bcd16bc5c4e50986961ad79d29801e67c889) Signed-off-by: Matt Blenkinsop --- Koha/REST/V1/Illrequests.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm index 82c5b5dd08..5b20516836 100644 --- a/Koha/REST/V1/Illrequests.pm +++ b/Koha/REST/V1/Illrequests.pm @@ -64,7 +64,15 @@ sub list { # If necessary, only get those from a specified patron my @requests = Koha::Illrequests->search({ $hidden_statuses - ? ( status => { 'not in' => $hidden_statuses } ) + ? ( + -and => { + status => { 'not in' => $hidden_statuses }, + status_alias => [ -or => + { 'not in' => $hidden_statuses }, + { '=' => undef } + ] + } + ) : (), $args->{borrowernumber} ? ( borrowernumber => $args->{borrowernumber} ) -- 2.39.5