Bugzilla – Attachment 153725 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), 1.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-07-20 15:28:08 UTC
(
hide
)
Description:
Bug 33556: Path parameters are handled explicitly in the controllers
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-07-20 15:28:08 UTC
Size:
1.87 KB
patch
obsolete
>From 7927b4bda83ba503c9bc705047f4294d602daaf7 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. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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 512010dd813..116d4f7d1dd 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 0effcc5cacc..a9c4f8007c9 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.41.0
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