Bugzilla – Attachment 171390 Details for
Bug 37902
Timezone ignored when passing rfc3339 formatted date (search 'q')
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37902: Make sure filtered_params are converted
Bug-37902-Make-sure-filteredparams-are-converted.patch (text/plain), 2.86 KB, created by
Jonathan Druart
on 2024-09-12 12:56:17 UTC
(
hide
)
Description:
Bug 37902: Make sure filtered_params are converted
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-09-12 12:56:17 UTC
Size:
2.86 KB
patch
obsolete
>From 9450313f02bccef548e2f908579085e8da7fc164 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 12 Sep 2024 10:41:18 +0200 >Subject: [PATCH] Bug 37902: Make sure filtered_params are converted > >Previously we only adjusted the attributes that were passed directly, >not the ones in 'q' (which is the recommended way now) >--- > Koha/REST/Plugin/Objects.pm | 32 +++++++++++++++----------------- > 1 file changed, 15 insertions(+), 17 deletions(-) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index a6b9ab6c3da..2b1dbbe83ca 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -209,20 +209,10 @@ controller, and thus shouldn't be called twice in it. > } > ); > >- # Call the to_model function by reference, if defined >- if ( defined $filtered_params ) { >- >- # Apply the mapping function to the passed params >- $filtered_params = >- $result_set->attributes_from_api($filtered_params); >- $filtered_params = >- $c->build_query_params( $filtered_params, $reserved_params ); >- } >- >+ my $query_params; > if ( defined $reserved_params->{q} > || defined $reserved_params->{query} ) > { >- $filtered_params //= {}; > > my @query_params_array; > >@@ -261,18 +251,12 @@ controller, and thus shouldn't be called twice in it. > } > } > >- my $query_params; >- > if ( scalar(@query_params_array) > 1 ) { > $query_params = { '-and' => \@query_params_array }; > } > else { > $query_params = $query_params_array[0]; > } >- >- $filtered_params = >- $c->merge_q_params( $filtered_params, $query_params, >- $result_set ); > } > > # request sequence id (i.e. 'draw' Datatables parameter) >@@ -287,6 +271,20 @@ controller, and thus shouldn't be called twice in it. > $c->stash('koha.pagination.base_total' => $result_set->count); > $c->stash('koha.pagination.query_params' => $args); > >+ >+ # Apply the mapping function to the passed params >+ if ( defined $filtered_params ) { >+ $filtered_params = >+ $c->build_query_params( $filtered_params, $reserved_params ); >+ } >+ >+ $filtered_params = >+ $c->merge_q_params( $filtered_params, $query_params, >+ $result_set ); >+ >+ $filtered_params = >+ $result_set->attributes_from_api($filtered_params); >+ > $c->dbic_validate_operators( { filtered_params => $filtered_params } ); > > # Generate the resultset >-- >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 37902
:
171389
|
171390
|
171391
|
171392
|
171402
|
171403
|
171515
|
171551
|
171652
|
171762
|
171763
|
171764
|
171765
|
171766
|
171767
|
171768
|
172105
|
172106
|
172107
|
172108
|
172109
|
172110
|
172111
|
172112