Bug 12755 - MARC Preview doesn't always display in managed MARC record
Summary: MARC Preview doesn't always display in managed MARC record
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 12983 (view as bug list)
Depends on:
Blocks: 12994
  Show dependency treegraph
 
Reported: 2014-08-13 16:51 UTC by Elaine Bradtke
Modified: 2015-06-04 23:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12755 - MARC Preview doesn't always display in managed MARC record (5.02 KB, patch)
2014-09-23 17:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12755 - MARC Preview doesn't always display in managed MARC record (5.03 KB, patch)
2014-09-24 19:53 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 12755 - MARC Preview doesn't always display in managed MARC record (5.09 KB, patch)
2014-09-25 10:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Elaine Bradtke 2014-08-13 16:51:46 UTC
In Manage MARC records If I try to look at an individual record, the popup MARC preview window doesn't appear.

This is where it doesn't appear:
Using Google Chrome on a Mac running OS X (10.9.4)
Using Firefox on a Mac running OS X (10.9.4)
Using Google Chrome on Windows 7
Using Firefox on Windows 7

The bottom left hand box on the screen says Javascript:void(0)
But:
It works as expected running Google Chrome on a virtual machine (Windows XP, yeah, I know).

I have disabled all the extensions, thinking one of them might have been blocking it, but it still doesn't work in the Managed staged records.
The MARC preview popup box works fine in the Z39.50 search 
In response to my question on the list
Owen Leonard wrote:
"I have seen this problem in Windows (7) with Firefox and have
confirmed that it still exists in master. There is a JavaScript error:

TypeError: $(...).html(...).dialog is not a function
/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=XX
Line 226

I'm guessing this problem was introduced by Bug 10558 - Convert
records table in manage-marc-import.pl to Ajax DataTable"
Comment 1 Owen Leonard 2014-09-23 17:48:03 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-09-24 11:16:19 UTC
*** Bug 12983 has been marked as a duplicate of this bug. ***
Comment 3 Biblibre Sandboxes 2014-09-24 19:53:33 UTC
Patch tested with a sandbox, by Nick Clemens <nick@quecheelibrary.org>
Comment 4 Biblibre Sandboxes 2014-09-24 19:53:55 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens 2014-09-24 19:55:19 UTC
I like the new look of the box as well, thanks Owen!
Comment 6 Jonathan Druart 2014-09-25 10:10:31 UTC
Created attachment 31869 [details] [review]
Bug 12755 - MARC Preview doesn't always display in managed MARC record

The MARC preview feature seems to have been broken by Bug 11570 -
Upgrade jQueryUI to the latest version. When that patch was being
developed there were no existing cases where the jQueryUI dialog feature
was used, so the patch omitted it.

Rather than update the build of jQueryUI to include the dialog feature
I'm submitting a patch which uses a Bootstrap modal instead. This keeps
the jQueryUI library smaller and avoids an unnecessary duplication of JS
functionality. It also helps keep our modals consistent.

The implementation uses progressive enhancement principles to improve
click handling: Real links in the table, so that the preview link can be
opened in a new tab if the user chooses; Event handling in the
JavaScript instead of the markup ( $(selector).on(click... instead of <a
onclick=...).

To test, apply the patch and add or view a batch of staged MARC records
(Tools -> Staged MARC management). In the list of titles (the "Citation"
column) click any link and confirm that the MARC preview loads
correctly. Confirm that previews work correctly on any page and after
re-sorting.

Confirm also that the modal window flexibly handles different browser
window sizes.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2014-09-25 10:11:36 UTC
Nice :) I should use it for bug 11395 too!
Comment 8 Tomás Cohen Arazi 2014-10-10 00:06:04 UTC
Patch pushed to master.

Thanks Owen!