[Bug 27029] New: Detail page missing Javascript accessible biblionumber value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Bug ID: 27029 Summary: Detail page missing Javascript accessible biblionumber value Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org Bug 26890 raises the point that there's no biblionumber on the detail page that is easily Javascript accessible. We really should be publishing the biblionumber in a feature-independent way, so that different features can leverage the same biblionumber. Here's my ideas so far: 1. data-biblionumber attribute in the body element 2. A RDFa schema.org identifier put in a child of the div.record element 3. Use Template::Toolkit to create a Javascript object that contains the biblionumber as a property 4. HTML element like "<span class="label">Catalogue ID</span>: <span id="biblionumber">1234</span>" I'm actually kind of inclined towards #4, since I have occasionally had people ask for the biblionumber to be published on the HTML to make it easier to see and reference... (although more so for the Staff Interface than the OPAC admittedly) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26890 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Ok maybe not body as that would involve updating bodytag.inc, which is too far reaching. div#catalogue_detail_biblio would work though as follows: <div id="catalogue_detail_biblio" class="maincontent" data-biblionumber="29"> Looks like the schema.org is partially in the XSLT and partially in opac-detail.tt so that's... no. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #1)
<div id="catalogue_detail_biblio" class="maincontent" data-biblionumber="29">
Then you can grab the biblionumber as easily as doing the following: document.querySelector("div#catalogue_detail_biblio").dataset.biblionumber; Or jquery: $("div#catalogue_detail_biblio").attr("data-biblionumber"); $("div#catalogue_detail_biblio").data("biblionumber"); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 113648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113648&action=edit Bug 27029: Add data-biblionumber attribute to OPAC detail page This patch adds a data-biblionumber attribute to the div#catalogue_detail_biblio elements on opac-detail.pl, so that Javascript running on the page can easily fetch and use the record's biblionumber. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Note that this would be useful for Koha plugins or any OPACUserJS which wants to add functionality onto the OPAC detail page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |dcook@prosentient.com.au --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Adding myself as Assignee, but still curious what Owen Leonard thinks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@trust-box.at --- Comment #6 from Mark Hofstetter <koha@trust-box.at> --- Thx for the quick uptake on my idea/wish I'll look into it, I'll try to make it today -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #7 from Mark Hofstetter <koha@trust-box.at> --- I tested this fix, what is the process to sign it off? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Mark Hofstetter from comment #7)
I tested this fix, what is the process to sign it off?
Thanks, Mark. You should be able to find everything you need here: https://wiki.koha-community.org/wiki/Git_bz_configuration#Signing_off Since you've already marked it as Signed Off on Bugzilla, it basically boils down to adding a "Signed-off-by: Mark Hofstetter <koha@trust-box.at>" to the bottom of my patch and re-uploading to replace my original patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113648|0 |1 is obsolete| | --- Comment #9 from Mark Hofstetter <koha@trust-box.at> --- Created attachment 113705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113705&action=edit Bug 27029: Add data-biblionumber attribute to OPAC detail page This patch adds a data-biblionumber attribute to the div#catalogue_detail_biblio elements on opac-detail.pl, so that Javascript running on the page can easily fetch and use the record's biblionumber. Signed-off-by: Mark Hofstetter <mark@hofstetter.at>, <koha@trust-box.at> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Perfect, Mark! If you go to https://dashboard.koha-community.org/, you'll also see that your name now appears in the list of sign offs as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #11 from Mark Hofstetter <koha@trust-box.at> --- until the patch is in core you may use // "if" statment may/has to be removed when // https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 // is in koha var biblionumber = $("div#catalogue_detail_biblio").data("biblionumber"); if (!biblionumber) { var x = document.getElementsByClassName("unapi-id")[0] .getAttribute("title"); biblionumber = x.split(':')[2]; } see https://github.com/HKS3/koha-plugin-subordinate-items/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113705|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 115675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115675&action=edit Bug 27029: Add data-biblionumber attribute to OPAC detail page This patch adds a data-biblionumber attribute to the div#catalogue_detail_biblio elements on opac-detail.pl, so that Javascript running on the page can easily fetch and use the record's biblionumber. Signed-off-by: Mark Hofstetter <mark@hofstetter.at>, <koha@trust-box.at> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 115676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115676&action=edit Bug 27029: (QA follow-up) Adding html filter Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115862&action=edit Bug 27029: Add a selenium regression test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.03 released in| | Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Nice small enhancement, I choose to backport. Pushed to 20.11.x for 20.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Version(s)|21.05.00,20.11.03 |21.05.00,20.11.03,20.05.09 released in| | --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Agreed, this seems small and handy. Pushed t0 20.05.x for 20.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED CC| |victor@tuxayo.net --- Comment #18 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27029 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28021 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28021 [Bug 28021] OPAC detail page contains incorrect Bootstrap classes (20.05.x) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org