From dc97c44a2b8b3fa0d7efae469120e0eded9c4b2b Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 2 Sep 2024 14:51:31 +0000 Subject: [PATCH] Bug 37810: Consider ServiceActive on status response Some SUSHI providers return ServiceActive instead of the documented Service_Active: https://countermetrics.stoplight.io/docs/counter-sushi-api/f0dd30f814944-server-status This ensures the test connection does not fail regardless of what is used --- Koha/ERM/EUsage/UsageDataProvider.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/ERM/EUsage/UsageDataProvider.pm b/Koha/ERM/EUsage/UsageDataProvider.pm index e85ee58ce8..f9bac673e2 100644 --- a/Koha/ERM/EUsage/UsageDataProvider.pm +++ b/Koha/ERM/EUsage/UsageDataProvider.pm @@ -301,10 +301,10 @@ sub test_connection { my $status; if ( ref($result) eq 'ARRAY' ) { for my $r (@$result) { - $status = $r->{Service_Active}; + $status = $r->{Service_Active} // $->{ServiceActive}; } } else { - $status = $result->{Service_Active}; + $status = $result->{Service_Active} // $result->{ServiceActive}; } if ($status) { -- 2.39.2