Bugzilla – Attachment 76920 Details for
Bug 20287
Move AddMember and ModMember to Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20287: Replace occurrences of ModMember in REST API
Bug-20287-Replace-occurrences-of-ModMember-in-REST.patch (text/plain), 1.79 KB, created by
Jonathan Druart
on 2018-07-12 18:50:35 UTC
(
hide
)
Description:
Bug 20287: Replace occurrences of ModMember in REST API
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-12 18:50:35 UTC
Size:
1.79 KB
patch
obsolete
>From 9c9073496dd14a69318498b7221bfe05348bd0e5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Mar 2018 12:59:18 -0300 >Subject: [PATCH] Bug 20287: Replace occurrences of ModMember in REST API > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Patrons.pm | 21 +++------------------ > 1 file changed, 3 insertions(+), 18 deletions(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index a24a7d50e4..a43d57114b 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -19,7 +19,6 @@ use Modern::Perl; > > use Mojo::Base 'Mojolicious::Controller'; > >-use C4::Members qw( ModMember ); > use Koha::Patrons; > > use Scalar::Util qw(blessed); >@@ -196,23 +195,9 @@ sub update { > return try { > my $body = _to_model($c->validation->param('body')); > >- ## TODO: Use ModMember until it has been moved to Koha-namespace >- # Add borrowernumber to $body, as required by ModMember >- $body->{borrowernumber} = $patron_id; >- >- if ( ModMember(%$body) ) { >- # Fetch the updated Koha::Patron object >- $patron->discard_changes; >- return $c->render( status => 200, openapi => $patron ); >- } >- else { >- return $c->render( >- status => 500, >- openapi => { >- error => 'Something went wrong, check Koha logs for details.' >- } >- ); >- } >+ $patron->set($body)->store; >+ $patron->discard_changes; >+ return $c->render( status => 200, openapi => $patron ); > } > catch { > unless ( blessed $_ && $_->can('rethrow') ) { >-- >2.11.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 20287
:
73436
|
76901
|
76902
|
76903
|
76904
|
76905
|
76906
|
76907
|
76908
|
76909
|
76910
|
76911
|
76912
|
76913
|
76914
|
76915
|
76916
|
76917
|
76918
|
76919
| 76920 |
76921
|
76922
|
76923
|
76924
|
76927
|
77221