[Bug 12758] New: XSLT imports containing a https href in a XSLT stylesheet fail to work with LibXML's load_xml in XSLT_Handler
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 Bug ID: 12758 Summary: XSLT imports containing a https href in a XSLT stylesheet fail to work with LibXML's load_xml in XSLT_Handler Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- See also IRC discussion on August 14, 2014 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 --- Comment #2 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Just to narrow down the problem: You can use https:etc.xsl in load_xml, but if you include an import href="https:utils.xsl" in that etc.xsl, it fails to load. Seems to be a problem of XML::LibXML, but would be nice to resolve it one way or the other.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Have sent an email to the cpan author of LibXML.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12973 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Patch complexity|--- |Small patch Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12973 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|XSLT imports containing a |Failure when loading or |https href in a XSLT |parsing XSLT stylesheets |stylesheet fail to work |over HTTPS |with LibXML's load_xml in | |XSLT_Handler | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- I have renamed this report to widen its scope. Actually, I see here two related problems: 1) LibXML does not like https references when loading xml with the location parameter. This can be resolved by reading the file into a string and passing it to load_xml via the string parameter. (A solution within LibXML for https appears not to be expected for now.) Note btw bthat reading the file might not be working rightaway. If you LWP::UserAgent to get the file contents, it will need LWP::Protocol::https. This dependency was recently added to Koha as optional in the context of OverDrive integration. Should we mark it as required now? 2) If the stylesheet (via local file, http or https) contains an import with a https reference, LibXML can load it (possibly with the workaround under point 1), but LibXSLT will now fail parsing it with: "I/O warning : failed to load external entity". This is harder to resolve; we should not be replacing imports in xslt code ourselves. The problem seems to go down deeper to the libxml2 C library. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 --- Comment #5 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 31974 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31974&action=edit Bug 12758: Workaround for loading stylesheets over https LibXML does not like https references when loading xml with the location parameter. This can be resolved by reading the file into a string and passing it to load_xml via the string parameter. Note that LWP::UserAgent will only load the file if LWP::Protocol::https is installed. This is an optional perl dependency in Koha. I mark it as required now. Also note that if your stylesheet contains an import with a https reference, this fix is not enough. The load_xml call will not fail, but the succeeding call to parse_stylesheet will still fail. As a workaround, make your import file accessible via http. NOTE: Some code taken from report 12172. With thanks to Martin Renvoize. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31974|0 |1 is obsolete| | --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 31975 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31975&action=edit Bug 12758: Workaround for loading stylesheets over https LibXML does not like https references when loading xml with the location parameter. This can be resolved by reading the file into a string and passing it to load_xml via the string parameter. Note that LWP::UserAgent will only load the file if LWP::Protocol::https is installed. This is an optional perl dependency in Koha. I mark it as required now. Also note that if your stylesheet contains an import with a https reference, this fix is not enough. The load_xml call will not fail, but the succeeding call to parse_stylesheet will still fail. As a workaround, make your import file accessible via http. NOTE: Some code taken from report 12172. With thanks to Martin Renvoize. Test plan: Take for example OPACXSLTDetailsDisplay and replace it by a https ref. Check opac detail display. Note that replacing OPACXSLTResultsDisplay by some https ref would also test repeating the call. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|m.de.rooy@rijksmuseum.nl |koha-bugs@lists.koha-commun | |ity.org --- Comment #7 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Changing the status of this report to an arbitrary Failed QA. I do not really like the workaround; it does pollute the code. But it works if you look for a workaround for this problem. A solution at the level of LibXML/LibXSLT would be much better. The Failed QA status still allows this report to be found when 'google' searching in Bugzilla. Only change the status please, if you have a good reason for doing so. Thanks. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org