View | Details | Raw Unified | Return to bug 40424
Collapse All | Expand All

(-)a/Koha/REST/Plugin/Objects.pm (-12 / +6 lines)
Lines 216-243 controller, and thus shouldn't be called twice in it. Link Here
216
            my $query_params;
216
            my $query_params;
217
217
218
            my $q_param = $reserved_params->{q};
218
            my $q_param = $reserved_params->{q};
219
            my $q_body  = $c->req->json;
219
220
220
            if ( $q_param
221
            if ( $q_param || $q_body ) {
221
                || defined $reserved_params->{query} )
222
            {
223
222
224
                my @query_params_array;
223
                my @query_params_array;
225
224
226
                my $json = JSON->new;
225
                my $json = JSON->new;
227
226
228
                # query in request body, JSON::Validator already decoded it
229
                if ( $reserved_params->{query} ) {
230
                    my $query = $json->encode( $reserved_params->{query} );
231
                    foreach my $qf ( @{$query_fixers} ) {
232
                        $query = $qf->($query);
233
                    }
234
                    push @query_params_array, $json->decode($query);
235
                }
236
237
                # The q parameter can be an array if multiple passed
227
                # The q parameter can be an array if multiple passed
238
                $q_param = [$q_param]
228
                $q_param = [$q_param]
239
                    unless ref($q_param) eq 'ARRAY';
229
                    unless ref($q_param) eq 'ARRAY';
240
230
231
                # Encode the already decoded request body and add it for processing
232
                push @{$q_param}, $json->encode($q_body)
233
                    if $q_body;
234
241
                foreach my $q ( @{$q_param} ) {
235
                foreach my $q ( @{$q_param} ) {
242
                    if ($q) {    # skip if exists but is empty
236
                    if ($q) {    # skip if exists but is empty
243
                        foreach my $qf ( @{$query_fixers} ) {
237
                        foreach my $qf ( @{$query_fixers} ) {
(-)a/Koha/REST/Plugin/Query.pm (-2 / +1 lines)
Lines 348-354 This helper method parses the 'x-koha-request-id' header and stashes the value. Link Here
348
348
349
sub _reserved_words {
349
sub _reserved_words {
350
350
351
    my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q query);
351
    my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q );
352
    return \@reserved_words;
352
    return \@reserved_words;
353
}
353
}
354
354
355
- 

Return to bug 40424