From dcbd3e69295a778788f0d3d840b3edc30a8657e1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi 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. Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- Koha/REST/Plugin/Objects.pm | 3 +-- Koha/REST/V1/Acquisitions/Orders.pm | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm index 512010dd81..116d4f7d1d 100644 --- a/Koha/REST/Plugin/Objects.pm +++ b/Koha/REST/Plugin/Objects.pm @@ -157,8 +157,7 @@ controller, and thus shouldn't be called twice in it. $query_fixers //= []; # 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); if ( exists $reserved_params->{_order_by} ) { diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm index 0effcc5cac..a9c4f8007c 100644 --- a/Koha/REST/V1/Acquisitions/Orders.pm +++ b/Koha/REST/V1/Acquisitions/Orders.pm @@ -46,8 +46,10 @@ sub list { return try { - my $only_active = delete $c->validation->output->{only_active}; - my $order_id = delete $c->validation->output->{order_id}; + my $only_active = $c->param('only_active'); + my $order_id = $c->param('order_id'); + + $c->req->params->remove('only_active')->remove('order_id'); my $orders_rs; -- 2.39.2