Bugzilla – Attachment 95078 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), 3.02 KB, created by
Jonathan Druart
on 2019-11-06 08:50:47 UTC
(
hide
)
Description:
Bug 23075: Report if mana-kb server is not found
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-06 08:50:47 UTC
Size:
3.02 KB
patch
obsolete
>From 016c8f2a503ec34c252a6feef841ac0bbfb93eeb 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. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/share_content.pl | 16 +++++++++++----- > .../intranet-tmpl/prog/en/modules/admin/share_content.tt | 4 ++++ > 2 files changed, 15 insertions(+), 5 deletions(-) > >diff --git a/admin/share_content.pl b/admin/share_content.pl >index 46f270e9e3..7bfa3c82ad 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') || q{}; >@@ -64,8 +72,7 @@ if ( $op eq 'send' ) { > my $content = to_json({name => $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); >@@ -78,10 +85,9 @@ if ( $op eq 'send' ) { > } > > >-my $mana_url = C4::Context->config('mana_config') || q{}; >- > $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 1a3bcd8efd..d441b06dc6 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.11.0
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