Bugzilla – Attachment 83778 Details for
Bug 20640
Allow migrating a request between backends
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20640: (follow-up) Degrade gracefully on error
Bug-20640-follow-up-Degrade-gracefully-on-error.patch (text/plain), 2.33 KB, created by
Martin Renvoize (ashimema)
on 2019-01-11 12:42:30 UTC
(
hide
)
Description:
Bug 20640: (follow-up) Degrade gracefully on error
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-01-11 12:42:30 UTC
Size:
2.33 KB
patch
obsolete
>From 006317fe8fcc2ac2d0d22208e3af92ff323d8016 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 1 Nov 2018 15:29:08 +0000 >Subject: [PATCH] Bug 20640: (follow-up) Degrade gracefully on error > >--- > Koha/Illrequest.pm | 5 +++-- > ill/ill-requests.pl | 24 ++++++++++++++++++++---- > 2 files changed, 23 insertions(+), 6 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index f9b49955ee..ff834f14f5 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -536,11 +536,12 @@ Migrate a request from one backend to another. > sub backend_migrate { > my ( $self, $params ) = @_; > >- my $response = $self->_backend->migrate({ >+ my $response = $self->_backend_capability('migrate',{ > request => $self, > other => $params, > }); >- return $self->expandTemplate($response); >+ return $self->expandTemplate($response) if $response; >+ return $response; > } > > =head2 backend_confirm >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 0a29785147..77a8d05560 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -93,10 +93,26 @@ if ( $backends_available ) { > if ( $params->{backend} ) { > my $new_request = Koha::Illrequest->new->load_backend( $params->{backend} ); > $backend_result = $new_request->backend_migrate($params); >- $template->param( >- whole => $backend_result, >- request => $new_request >- ); >+ if ($backend_result) { >+ $template->param( >+ whole => $backend_result, >+ request => $new_request >+ ); >+ } else { >+ # backend failure >+ $backend_result = { >+ stage => 'commit', >+ next => 'illview', >+ error => { >+ message => 'Migrating to backedn does not support migrate', >+ status => 'Migrating to backedn does not support migrate' >+ } >+ }; >+ $template->param( >+ whole => $backend_result, >+ request => $request >+ ); >+ } > } > else { > $request = Koha::Illrequests->find( $params->{illrequest_id} ); >-- >2.19.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 20640
:
74903
|
75430
|
75431
|
78525
|
79508
|
79571
|
79597
|
80900
|
81826
|
81827
|
83777
|
83778
|
83779
|
83797
|
83798
|
83799
|
83800
|
83801
|
83803
|
83805
|
83806
|
83807
|
83808
|
83809
|
83810