Bug 24084: PlainMARC view broken on OPAC if other $.ajax calls produce errors
authorOwen Leonard <oleonard@myacpl.org>
Thu, 21 Nov 2019 18:08:48 +0000 (18:08 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 25 Nov 2019 08:33:00 +0000 (08:33 +0000)
commit770f24d4f7da01434fb2318425e4275ec791db8f
tree3a06296298d126064a66a94529958e848173de32
parent1ca7b6c40cfc78bbeaf0c9d5bebeeb2e3b5ce611
Bug 24084: PlainMARC view broken on OPAC if other $.ajax calls produce errors

This patch removes the use of jQuery's ajaxSetup() and load() to get the
"plain" MARC view and replaces it with $.get(). This allows for
error-handling on this specific AJAX request rather than all on the
page.

To test, apply the patch and view a bibliographic record in the OPAC.

 - Click the "MARC view" tab.
 - Click the "view plain" link.
  - The plain-text MARC view should load.
  - Clicking "view labeled" should return you to the original view.

To test error handling, edit opac-MARCdetail.tt line 185 and add a typo
to the URL, e.g. "opac-showmark.pl." Repeat the above steps. Clicking
the "view plain" link should trigger an error message: "Sorry, plain
view is temporarily unavailable."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt