[Bug 21887] New: 856$u link problem in XSLT result lists and detail page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Bug ID: 21887 Summary: 856$u link problem in XSLT result lists and detail page Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: kohadevinim@devinim.com.tr QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Created attachment 82674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82674&action=edit Sample MARC record İf you dont add http:// or ftp:// in front of link pages in 856$u field, intranet webpage search result and detail page yields to connect localhost. -- 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=21887 Devinim <kohadevinim@devinim.com.tr> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kohadevinim@devinim.com.tr |ity.org | -- 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=21887 --- Comment #1 from Devinim <kohadevinim@devinim.com.tr> --- Created attachment 82675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82675&action=edit Bug 21887: 856 link problem in XSLT result lists and detail page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Devinim <kohadevinim@devinim.com.tr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Devinim <kohadevinim@devinim.com.tr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82675|0 |1 is obsolete| | --- Comment #2 from Devinim <kohadevinim@devinim.com.tr> --- Created attachment 82676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82676&action=edit Bug 21887: 856 link problem in XSLT result lists and detail page Test plan; 1) Add web page link without http:// or ftp:// prefix in 856$u or use Sample Marc record 2) Search record from intranet web page and examine that link in online resources section shows localhost. 3) Apply this patch 4) Search similar record and test link is working correctly Signed-off-by: Devinim <kohadevinim@devinim.com.tr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> ---
From LOC: $u - Uniform Resource Identifier Uniform Resource Identifier (URI), which provides standard syntax for locating an object using existing Internet protocols. Field 856 is structured to allow for the creation of a URL from the concatenation of other separate 856 subfields. Subfield $u may be used instead of those separate subfields or in addition to them.
I am not sure if we fully comply with that currently (probably not). This does not either. But still looks good to me.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #4 from Devinim <kohadevinim@devinim.com.tr> --- Created attachment 82677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82677&action=edit Bug 21887: (For OPAC) 856 link problem in XSLT result lists and detail page Test plan (for OPAC); 1) Add web page link without http:// or ftp:// prefix in 856$u or use Sample Marc record 2) Search record from OPAC web page and examine that link in online resources section shows localhost. 3) Apply this patch 4) Search similar record and test link is working correctly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 82677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82677 Bug 21887: (For OPAC) 856 link problem in XSLT result lists and detail page Review of attachment 82677: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21887&attachment=82677) ----------------------------------------------------------------- ::: koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ +1078,5 @@
<xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> </xsl:when> <xsl:otherwise> + <xsl:attribute name="href"> + <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
I could imagine malformed (yet functional) URLs could cause some problems here. Maybe you'd like to try out http://exslt.org/regexp/index.html to be more precise? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #6 from David Cook <dcook@prosentient.com.au> --- I think you could use starts-with instead as well: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/starts-with Although I suppose leading whitespace could cause a problem -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #7 from Devinim <kohadevinim@devinim.com.tr> --- Hi David, Can you share a sample for malformed but functional URL? Thanks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Devinim from comment #7)
Hi David, Can you share a sample for malformed but functional URL? Thanks.
Sure, I was thinking something like "koha-community.org?redirect=http://other-site.org" That string would not be caught by this test: <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> Apologies for my wording of "malformed but functional URL". What I meant was a a URL missing a scheme but containing an unencoded URL in the query string. Technically, the value of redirect should be encoded, but browsers will typically work with it anyway. If I put "koha-community.org?redirect=http://other-site.org" into a Chrome browser, it'll work. But according to your use case, it will try to connect to localhost. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Stefan Berndtsson <stefan.berndtsson@ub.gu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan.berndtsson@ub.gu.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #9 from Devinim <kohadevinim@devinim.com.tr> --- (In reply to David Cook from comment #6)
I think you could use starts-with instead as well:
https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/starts-with
Although I suppose leading whitespace could cause a problem
starts-with cannot work the version of xslt we use in koha, am I correct? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Liz Rea <wizzyrea@gmail.com> 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=21887 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82676|0 |1 is obsolete| | Attachment #82677|0 |1 is obsolete| | --- Comment #10 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 90041 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90041&action=edit Bug 21887: 856 link problem in XSLT result lists and detail page Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr> Signed-off-by: Liz Rea <wizzyrea@gmail.com> I don't think we need to worry about David's edge case. This improves the behaviour significantly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #11 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 90042 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90042&action=edit Bug 21887: (For OPAC) 856 link problem in XSLT result lists and detail page Signed-off-by: Liz Rea <wizzyrea@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90041|0 |1 is obsolete| | --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 90097 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90097&action=edit Bug 21887: 856 link problem in XSLT result lists and detail page Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90042|0 |1 is obsolete| | --- Comment #13 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 90098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90098&action=edit Bug 21887: (For OPAC) 856 link problem in XSLT result lists and detail page Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |chris@bigballofwax.co.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- (In reply to Devinim from comment #9)
starts-with cannot work the version of xslt we use in koha, am I correct?
starts-with should be part of XSLT 1.0, so it should be part of libxml used by Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- (In reply to Liz Rea from comment #10)
I don't think we need to worry about David's edge case. This improves the behaviour significantly.
No argument here. In the case I mentioned, I prefer to update the URL data in the database anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m, | |martin.renvoize@ptfs-europe | |.com --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'd love to see a selenium test to cover this to repent future regressions... and do we need to submit corresponding bugs for Unimarc? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version(s)| |19.11.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=21887 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable Version(s)|19.11.00 |19.11.00,19.05.01 released in| | --- Comment #18 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #19 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 18.11.x for 18.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23423 CC| |katrin.fischer@bsz-bw.de --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Unfortunately this causes a regression with any relative links added by the opload feature no longer working: bug 23423 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23423 [Bug 23423] Online resource links which are OPAC retrieve file references are not correctly formatted in the OPAC detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |chris@bigballofwax.co.nz |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|19.11.00,19.05.01 |19.11.00,19.05.01,18.11.07 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21887 Doug Dearden <dearden@sarsf.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dearden@sarsf.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org