Bugzilla – Attachment 149402 Details for
Bug 18829
Elasticsearch - Add ability to view the ES indexed record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18829: (follow-up) Return 404 when record cannot be loaded
Bug-18829-follow-up-Return-404-when-record-cannot-.patch (text/plain), 2.51 KB, created by
Katrin Fischer
on 2023-04-10 17:08:11 UTC
(
hide
)
Description:
Bug 18829: (follow-up) Return 404 when record cannot be loaded
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-04-10 17:08:11 UTC
Size:
2.51 KB
patch
obsolete
>From 864b32f9d7a6363d20cd07f9e892d7ad471d3f4c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 27 Mar 2023 11:53:45 +0000 >Subject: [PATCH] Bug 18829: (follow-up) Return 404 when record cannot be > loaded > >--- > catalogue/showelastic.pl | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++++- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/catalogue/showelastic.pl b/catalogue/showelastic.pl >index 1b9318cc3a..6bbf569b64 100755 >--- a/catalogue/showelastic.pl >+++ b/catalogue/showelastic.pl >@@ -31,8 +31,8 @@ use Try::Tiny; > > # Koha modules used > use C4::Context; >-use C4::Output; >-use C4::Auth; >+use C4::Output qw( output_html_with_http_headers ); >+use C4::Auth qw(get_template_and_user); > use C4::Biblio; > use C4::ImportBatch; > use C4::XSLT ; >@@ -65,8 +65,8 @@ try { > }); > } > catch{ >- @es_fields = ("Error fetching record: see logs for details"); > warn $_; >+ print $input->redirect("/cgi-bin/koha/errors/404.pl"); > }; > > for my $field (sort keys %{$es_record} ){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index e983999b14..9da3b22987 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -1747,7 +1747,11 @@ Note that permanent location is a code, and location may be an authval. > $("body").on("click",".previewElastic", function(e){ > e.preventDefault(); > var pageElastic = $(this).attr("href"); >- $("#elasticPreview .modal-body").load(pageElastic); >+ $("#elasticPreview .modal-body").load(pageElastic, function( response, status, xhr ) { >+ if( status == 'error' ){ >+ $("#elasticPreview .modal-body").html('<h1>An error has occurred!</h1><h2><em>Error 404</em></h2><li>An internal link in the client is broken and the page does not exist</li></ul><h3>What\'s next?</h3><ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;"><li>Use top menu bar to navigate to another part of Koha.</li><li>To report a broken link or any other issue, please contact the Koha administrator. <a href="mailto:[% Koha.Preference('KohaAdminEmailAddress') | uri %]">Send email</a></li></ul>'); >+ } >+ }); > $('#elasticPreview').modal({show:true}); > }); > [% END %] >-- >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 18829
:
64456
|
89001
|
89007
|
89248
|
89249
|
89250
|
90370
|
108103
|
108104
|
108191
|
108944
|
108945
|
148757
|
148758
|
148759
|
148760
|
149400
|
149401
| 149402 |
149403
|
149404
|
149745