Bugzilla – Attachment 152212 Details for
Bug 33556
$c->validation should be avoided (part 1)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33556: Path parameters are handled explicitly in the controllers
Bug-33556-Path-parameters-are-handled-explicitly-i.patch (text/plain), 2.10 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-06-08 16:30:44 UTC
(
hide
)
Description:
Bug 33556: Path parameters are handled explicitly in the controllers
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-06-08 16:30:44 UTC
Size:
2.10 KB
patch
obsolete
>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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33556
:
152212
|
152213
|
152214
|
152693
|
152694
|
152695
|
153725
|
153726
|
153727
|
153784
|
153785