Bug 34598: Improve handling of not found ILL request

1) Enable ILLmodule and install FreeForm, run:
   bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Visit a request that doesn't exist (assuming empty illrequests table):
   INTRA/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=1
3) Verify an error 500 is returned with message "Can't call method
   "backend_illview""
4) Apply patch
5) Repeat steps 1-3. Verify that a "ILL request not found." message is
   now displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-08-23 14:45:27 +00:00 committed by Tomas Cohen Arazi
parent 1e9d4dfdd5
commit 298043edb7
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,7 @@ use Modern::Perl;
use CGI;
use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
use C4::Output qw( output_and_exit output_html_with_http_headers );
use Koha::Notice::Templates;
use Koha::AuthorisedValues;
use Koha::Illcomment;
@ -97,6 +97,8 @@ if ( $backends_available ) {
( tran_success => $params->{tran_success} ) : () ),
);
output_and_exit( $cgi, $cookie, $template, 'unknown_ill_request' ) if !$request;
my $backend_result = $request->backend_illview($params);
$template->param(
whole => $backend_result,

View File

@ -13,6 +13,8 @@
<div class="dialog message">Basket not found.</div>
[% CASE 'unknown_vendor' %]
<div class="dialog message">Vendor not found.</div>
[% CASE 'unknown_ill_request' %]
<div class="dialog message">ILL request not found.</div>
[% CASE 'order_cannot_be_edited' %]
<div class="dialog message">This order cannot be edited, the basket is closed or the order was already received.</div>
[% CASE 'wrong_csrf_token' %]

View File

@ -1,3 +1,4 @@
[% INCLUDE 'blocking_errors.inc' %]
[% USE Koha %]
[% IF Koha.Preference('ILLModule ') && CAN_user_ill %]
<div id="toolbar" class="btn-toolbar">