Bug 20640: (follow-up) Make error message translatable
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 11 Jan 2019 14:50:47 +0000 (14:50 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 28 Jan 2019 13:06:31 +0000 (13:06 +0000)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

ill/ill-requests.pl
koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt

index 792b93d..d962773 100755 (executable)
@@ -74,6 +74,7 @@ if ( $backends_available ) {
             csrf_token => Koha::Token->new->generate_csrf({
                 session_id => scalar $cgi->cookie('CGISESSID'),
             }),
+            ( $params->{error} ? ( error => $params->{error} ) : () ),
         );
 
     } elsif ( $op eq 'create' ) {
@@ -100,19 +101,13 @@ if ( $backends_available ) {
                 );
                 $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
-                );
+                # Backend failure, redirect back to illview
+                print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl'
+                      . '?method=illview'
+                      . '&illrequest_id='
+                      . $request->id
+                      . '&error=migrate_target' );
+                exit;
             }
         }
         else {
index 5f707fe..63d58c7 100644 (file)
 
                 [% ELSIF query_type == 'illview' %]
                     [% req_status = request.status %]
+
+                    [% IF error %]
+                      [% IF error == 'migrate_target' %]
+                          <div class="alert">
+                              The backend you tried to migrate to does not yet support migrations, please try again with an alternative target.
+                          </div>
+                      [% END %]
+                    [% END %]
+
                     <h1>Manage ILL request</h1>
                     <div id="request-toolbar" class="btn-toolbar">
                         <a title="Edit request" id="ill-toolbar-btn-edit-action" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=edit_action&amp;illrequest_id=[% request.illrequest_id | html %]">