Bugzilla – Attachment 90682 Details for
Bug 23075
Incorrect URL should have a meaningful error message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23075: Report if mana-kb server is not found
Bug-23075-Report-if-mana-kb-server-is-not-found.patch (text/plain), 2.89 KB, created by
Martin Renvoize (ashimema)
on 2019-06-17 17:27:46 UTC
(
hide
)
Description:
Bug 23075: Report if mana-kb server is not found
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-17 17:27:46 UTC
Size:
2.89 KB
patch
obsolete
>From 36dc4ec5fe29d9799546f828e4f0837ed43af5ba Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 17 Jun 2019 18:24:04 +0100 >Subject: [PATCH] Bug 23075: Report if mana-kb server is not found > >This patch adds a status check into the mana configuration page and >prompts the user to ask an adminstrator to check the configured mana >service url. >--- > admin/share_content.pl | 17 +++++++++++------ > .../prog/en/modules/admin/share_content.tt | 4 ++++ > 2 files changed, 15 insertions(+), 6 deletions(-) > >diff --git a/admin/share_content.pl b/admin/share_content.pl >index 475771aad8..3beffb6b60 100755 >--- a/admin/share_content.pl >+++ b/admin/share_content.pl >@@ -39,6 +39,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > my $op = $query->param('op') || q||; >+my $mana_base = C4::Context->config('mana_config') || ''; >+# Check the mana server actually exists at the other end >+my $bad_url; >+if ($mana_base) { >+ my $request = HTTP::Request->new( GET => $mana_base ); >+ my $result = Koha::SharedContent::process_request($request); >+ $bad_url = 1 unless (exists($result->{version})); >+} > > if ( $op eq 'save' ) { > my $auto_share = $query->param('autosharewithmana'); >@@ -66,8 +74,7 @@ if ( $op eq 'send' ) { > lastname => $name, > email => $email}); > >- my $mana_ip = C4::Context->config('mana_config'); >- my $url = "$mana_ip/getsecuritytoken"; >+ my $url = "$mana_base/getsecuritytoken"; > my $request = HTTP::Request->new( POST => $url ); > $request->content($content); > my $result = Koha::SharedContent::process_request($request); >@@ -79,11 +86,9 @@ if ( $op eq 'send' ) { > } > } > >- >-my $mana_url = C4::Context->config('mana_config') || ''; >- > $template->param( >- mana_url => $mana_url, >+ mana_url => $mana_base, >+ bad_url => $bad_url, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >index 11d4e6c196..57f101a8a5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >@@ -33,6 +33,10 @@ > <div class="dialog alert" role="alert"> > Mana configuration is currently empty. This feature will not work. Please contact your site administrator. > </div> >+ [% ELSIF (bad_url) %] >+ <div class="dialog alert" role="alert"> >+ Cannot detect mana server at <strong>[% mana_url | url %]</strong>, please ask an administrator to check your configuration. >+ </div> > [% END %] > > <h1>Share content with the Koha community using Mana KB</h1> >-- >2.20.1
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 23075
:
90440
|
90459
|
90594
|
90595
|
90596
|
90606
|
90682
|
94098
|
94363
|
95000
|
95003
|
95009
|
95074
|
95075
|
95076
|
95078
|
95079
|
95080
|
95081