[Bug 32794] New: mailto links in 856 can be incorrectly formed by XSLT
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Bug ID: 32794 Summary: mailto links in 856 can be incorrectly formed by XSLT Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The current code checks for '://' in the 856, and adds http:// or ftp://, depending on first indicator, if it isn't present. The marc standard, however, lists more access methods that are not tested for or covered. mailto: won't meet the test for '://' and should be handled -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145999&action=edit Bug 32794: Expand tests for access method in XLST files This patch expands the checks for 856u to check for mailto, and adds a few conditiona checks of the first indicator to cover more methods Reference: https://www.oclc.org/bibformats/en/8xx/856.html To test: 1 - Edit a record and add a few 856 fields: 856 0 0 $umailto:test@example.org 856 0 0 $utest@example.org 856 2 0 $utelnet://pucc.princeton.edu 856 2 0 $upucc.princeton.edu 856 3 0 $u8885555555 2 - View staff details and results and opac details and results 3 - Note all links have been prepended with http:// 4 - Apply patch 5 - Refresh all views, ensure links are correctly formed -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Phil Ringnalda <phil@chetcolibrary.org> 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=32794 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145999|0 |1 is obsolete| | --- Comment #2 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 147745 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147745&action=edit Bug 32794: Expand tests for access method in XLST files This patch expands the checks for 856u to check for mailto, and adds a few conditiona checks of the first indicator to cover more methods Reference: https://www.oclc.org/bibformats/en/8xx/856.html To test: 1 - Edit a record and add a few 856 fields: 856 0 0 $umailto:test@example.org 856 0 0 $utest@example.org 856 2 0 $utelnet://pucc.princeton.edu 856 2 0 $upucc.princeton.edu 856 3 0 $u8885555555 2 - View staff details and results and opac details and results 3 - Note all links have been prepended with http:// 4 - Apply patch 5 - Refresh all views, ensure links are correctly formed Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org --- Comment #3 from Phil Ringnalda <phil@chetcolibrary.org> --- The "dial-up" one was particularly horrifying, since once I clicked through all the browser and OS warnings about "Dude, are you really clicking on a tel: link?" the only available handler app was Facetime. Thanks for choosing a number that wouldn't have gone through :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This is a bit of teasing: <xsl:when test="@ind1=7"> <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> But when you would put mailto inside $2, this goes wrong again ;) Not really a blocker, just noting a fictive improvement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 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 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> ---
From LOC 7 - Method specified in subfield $2 856 7#$3b&w film copy neg.$ddag$f3d01926$2file
Too bad that this example does not contain the full prefix in $2. Would have been easy to just remove the suffix :// from our xslt. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Looking here / might add follow-up -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147745|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148565 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148565&action=edit Bug 32794: Expand tests for access method in XLST files This patch expands the checks for 856u to check for mailto, and adds a few conditiona checks of the first indicator to cover more methods Reference: https://www.oclc.org/bibformats/en/8xx/856.html To test: 1 - Edit a record and add a few 856 fields: 856 0 0 $umailto:test@example.org 856 0 0 $utest@example.org 856 2 0 $utelnet://pucc.princeton.edu 856 2 0 $upucc.princeton.edu 856 3 0 $u8885555555 2 - View staff details and results and opac details and results 3 - Note all links have been prepended with http:// 4 - Apply patch 5 - Refresh all views, ensure links are correctly formed Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> 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=32794 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148566&action=edit Bug 32794: (follow-up) Consolidate shared code into one function (:template) Few extra lines for the $2 exception as noted on Bugzilla. Note: We should probably check why the utils xslt on opac and intranet have so much differences currently. 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=32794 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148567&action=edit Bug 32794: (follow-up) Replace code by new function (template) Test plan: Same as first patch. Bonus: Remove protocol from $u. Set first ind1 to 7. Put mailto in $2. Check link. Change $2 to tel. Check link. Change $2 to https. Check link. 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=32794 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #4)
This is a bit of teasing:
<xsl:when test="@ind1=7"> <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
But when you would put mailto inside $2, this goes wrong again ;) Not really a blocker, just noting a fictive improvement.
Ended up fixing it with three more lines. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 --- Comment #12 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to stable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32794 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=6892 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org