[Koha-bugs] [Bug 23075] Incorrect URL should have a meaningful error message

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 14 13:46:04 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23075

David Nind <david at davidnind.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #90459|0                           |1
        is obsolete|                            |

--- Comment #11 from David Nind <david at davidnind.com> ---
Created attachment 90594
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90594&action=edit
Bug 23075: Better error handling in Mana config

Currently, if you input an incorrect mana service URL in your config
(http rather than https for example) the error message you are given is
the direct output of a failed json parse.  We should be able to catch
such failures and display a more meaningful error to the end user.

This patch makes it display a more friendly message.

Test plan:

1. Add <mana_config>http://mana-test.koha-community.org</mana_config> to
/etc/koha/sites/<instancename>/koha-conf.xml (see etc/koha-conf.xml in the Koha
code repositoty for an example of where to add this; <instancename> if using
koha-testing-docker is kohadev).
2. Clear memcached and restart services so that the changes in your Koha
instance configuration are recognised (if using koha-testing-docker enter
flush_memcached and then restart_all).
3. From the staff client home page go to Koha administration > Additional
parameters > Share content with Mana KB.
4. Enable content sharing: change 'Use Mana KB for sharing content' to Yes and
press Save.
5. Enter your first name, last name and email address in the Configure Mana KB
section of the page and then press Send to Mana KB.
6. An error message is displayed, this may be something like 'malformed JSON
string, neither tag, array, object, number, string or atom, at character offset
0 (before "<html>\r\n<head><tit...") at /usr/share/perl5/JSON.pm line 171.'
7. Apply the patch (git so bz apply 23075).
8. Change the Mana config to the correct URL:
<mana_config>https://mana-test.koha-community.org</mana_config>
9. Repeat steps 2,3 and 5.
10. A more friendly/human readable error message is now displayed: 'Error
trying to connect or read response from the Mana server (Code: 301) Moved
Permanently'.

Signed-off-by: David Nind <david at davidnind.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list