Bugzilla – Attachment 155427 Details for
Bug 30719
ILL should provide the ability to create batch requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30719: (QA follow-up) c->validation fixes
Bug-30719-QA-follow-up-c-validation-fixes.patch (text/plain), 3.84 KB, created by
Pedro Amorim
on 2023-09-08 14:09:43 UTC
(
hide
)
Description:
Bug 30719: (QA follow-up) c->validation fixes
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-09-08 14:09:43 UTC
Size:
3.84 KB
patch
obsolete
>From 43de7d3083d465bed3c208809f16255b94a6b450 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 8 Sep 2023 13:32:43 +0000 >Subject: [PATCH] Bug 30719: (QA follow-up) c->validation fixes > >--- > Koha/REST/V1/IllbatchStatuses.pm | 8 ++++---- > Koha/REST/V1/Illbatches.pm | 8 ++++---- > Koha/REST/V1/Illrequests.pm | 2 +- > 3 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/REST/V1/IllbatchStatuses.pm b/Koha/REST/V1/IllbatchStatuses.pm >index 28d19da073..b2ed518b88 100644 >--- a/Koha/REST/V1/IllbatchStatuses.pm >+++ b/Koha/REST/V1/IllbatchStatuses.pm >@@ -50,7 +50,7 @@ Get one batch statuses > sub get { > my $c = shift->openapi->valid_input; > >- my $status_code = $c->validation->param('illbatchstatus_code'); >+ my $status_code = $c->param('illbatchstatus_code'); > > my $status = Koha::IllbatchStatuses->find( { code => $status_code } ); > >@@ -76,7 +76,7 @@ Add a new batch status > sub add { > my $c = shift->openapi->valid_input or return; > >- my $body = $c->validation->param('body'); >+ my $body = $c->req->json; > > my $status = Koha::IllbatchStatus->new($body); > >@@ -107,7 +107,7 @@ Update a batch status > sub update { > my $c = shift->openapi->valid_input or return; > >- my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } ); >+ my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } ); > > if ( not defined $status ) { > return $c->render( >@@ -142,7 +142,7 @@ sub delete { > > my $c = shift->openapi->valid_input or return; > >- my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } ); >+ my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } ); > > if ( not defined $status ) { > return $c->render( status => 404, openapi => { errors => [ { message => "ILL batch status not found" } ] } ); >diff --git a/Koha/REST/V1/Illbatches.pm b/Koha/REST/V1/Illbatches.pm >index 6c23a3036e..6b1fd95570 100644 >--- a/Koha/REST/V1/Illbatches.pm >+++ b/Koha/REST/V1/Illbatches.pm >@@ -106,7 +106,7 @@ Get one batch > sub get { > my $c = shift->openapi->valid_input; > >- my $batchid = $c->validation->param('illbatch_id'); >+ my $batchid = $c->param('illbatch_id'); > > my $batch = Koha::Illbatches->find($batchid); > >@@ -143,7 +143,7 @@ Add a new batch > sub add { > my $c = shift->openapi->valid_input or return; > >- my $body = $c->validation->param('body'); >+ my $body = $c->req->json; > > # We receive cardnumber, so we need to look up the corresponding > # borrowernumber >@@ -204,7 +204,7 @@ Update a batch > sub update { > my $c = shift->openapi->valid_input or return; > >- my $batch = Koha::Illbatches->find( $c->validation->param('illbatch_id') ); >+ my $batch = Koha::Illbatches->find( $c->param('illbatch_id') ); > > if ( not defined $batch ) { > return $c->render( >@@ -253,7 +253,7 @@ sub delete { > > my $c = shift->openapi->valid_input or return; > >- my $batch = Koha::Illbatches->find( $c->validation->param('illbatch_id') ); >+ my $batch = Koha::Illbatches->find( $c->param('illbatch_id') ); > > if ( not defined $batch ) { > return $c->render( status => 404, openapi => { error => "ILL batch not found" } ); >diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm >index ffa512d802..6b8d990904 100644 >--- a/Koha/REST/V1/Illrequests.pm >+++ b/Koha/REST/V1/Illrequests.pm >@@ -72,7 +72,7 @@ sub add { > Koha::Database->new->schema->txn_do( > sub { > >- my $body = $c->validation->param('body'); >+ my $body = $c->req->json; > $body->{backend} = delete $body->{ill_backend_id}; > $body->{borrowernumber} = delete $body->{patron_id}; > $body->{branchcode} = delete $body->{library_id}; >-- >2.30.2
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 30719
:
144281
|
144285
|
144286
|
144287
|
144288
|
144289
|
144290
|
144291
|
144292
|
144293
|
144294
|
144295
|
144296
|
144297
|
144298
|
144299
|
144300
|
144301
|
144302
|
145760
|
145869
|
145870
|
145876
|
145934
|
146152
|
147658
|
147929
|
147930
|
147931
|
147932
|
147933
|
147934
|
147952
|
147953
|
147954
|
147955
|
147956
|
151152
|
151153
|
151154
|
151155
|
151156
|
151284
|
151285
|
151286
|
151287
|
151288
|
151303
|
151304
|
151305
|
151306
|
151307
|
151308
|
151309
|
151310
|
151311
|
151312
|
151513
|
151514
|
151515
|
151516
|
151517
|
151519
|
151520
|
151521
|
151522
|
151523
|
151571
|
151572
|
151573
|
151574
|
151575
|
151611
|
151612
|
151613
|
151614
|
151615
|
151804
|
151805
|
151806
|
151807
|
151808
|
151809
|
154046
|
154047
|
154048
|
154049
|
154050
|
154051
|
154052
|
155421
|
155422
|
155423
|
155424
|
155425
|
155426
|
155427
|
155428
|
155429
|
155430
|
155431
|
155432
|
155433
|
155434
|
155435
|
156556
|
156748
|
156749
|
156752
|
156783
|
156785
|
156811
|
156812
|
156827
|
156828