From b866b3d2d9d2ed489cb68c50b891b66fc6166fc3 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Thu, 8 Jun 2023 11:52:11 -0300
Subject: [PATCH] Bug 33556: Path parameters are handled explicitly in the
 controllers

In the case of $c->objects->search_rs, the variable is just not used.
In the case of /acq/orders, it's a leftover from when we removed in the
helper. Check there are tests with path params everywhere (including
orders) and it has no effect.
---
 Koha/REST/Plugin/Objects.pm         |  3 +--
 Koha/REST/V1/Acquisitions/Orders.pm | 10 ----------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm
index 94baf03753b..436ac0b6e49 100644
--- a/Koha/REST/Plugin/Objects.pm
+++ b/Koha/REST/Plugin/Objects.pm
@@ -147,8 +147,7 @@ controller, and thus shouldn't be called twice in it.
             my $attributes = {};
 
             # Extract reserved params
-            my ( $filtered_params, $reserved_params, $path_params ) =
-              $c->extract_reserved_params($args);
+            my ( $filtered_params, $reserved_params ) = $c->extract_reserved_params($args);
 
             # Merge sorting into query attributes
             $c->dbic_merge_sorting(
diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm
index bb12ed0a536..2e0bdc89a95 100644
--- a/Koha/REST/V1/Acquisitions/Orders.pm
+++ b/Koha/REST/V1/Acquisitions/Orders.pm
@@ -122,16 +122,6 @@ sub list {
             $filtered_params = $c->build_query_params( $filtered_params, $reserved_params );
         }
 
-        if ( defined $path_params ) {
-
-            # Apply the mapping function to the passed params
-            $filtered_params //= {};
-            $path_params = $orders_rs->attributes_from_api($path_params);
-            foreach my $param (keys %{$path_params}) {
-                $filtered_params->{$param} = $path_params->{$param};
-            }
-        }
-
         if (   defined $reserved_params->{q}
             || defined $reserved_params->{query}
             || defined $reserved_params->{'x-koha-query'} )
-- 
2.34.1