Bug 12973

Summary: Allow passing code to XSLT_Handler instead of filename
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12758
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12754
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6681
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 12754, 12758    
Attachments: Bug 12973: Allow passing code to XSLT_Handler instead of filename
Bug 12973: Additional unit tests for XSLT_Handler.t
[Signed Off] Bug 12973: Allow passing code to XSLT_Handler instead of filename
[Signed Off] Bug 12973: Additional unit tests for XSLT_Handler.t
[PASSED QA] Bug 12973: Allow passing code to XSLT_Handler instead of filename
[PASSED QA] Bug 12973: Allow passing code to XSLT_Handler instead of filename
[PASSED QA] Bug 12973: Additional unit tests for XSLT_Handler.t
Bug 12973: (QA followup) warnings are features, test them

Description Marcel de Rooy 2014-09-20 07:58:32 UTC
This patch adds the option to pass a code string to the XSLT handler object instead of passing a filename.
This is achieved by a change to parameter hashref. The old style parameters are also allowed.
Note that this patch should not change behavior but will be used in future development: it will allow an easy workaround for bug 12758 and is needed by bug 12754 to apply stored xslt code.
Comment 1 Marcel de Rooy 2014-09-25 09:37:36 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2014-09-25 09:37:41 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize 2014-11-14 09:12:58 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize 2014-11-14 09:13:04 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize 2014-11-14 09:13:42 UTC
Works for me, no regressions.

Tests all pass, and code passes qa scripts, happy to sign off.
Comment 6 Kyle M Hall 2014-12-12 14:46:15 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2014-12-12 14:53:26 UTC
Created attachment 34353 [details] [review]
[PASSED QA] Bug 12973: Allow passing code to XSLT_Handler instead of filename

This patch adds the option to pass a code string to the XSLT handler object
instead of passing a filename.
This is achieved by a change to parameter hashref. The old style parameters
are also allowed.
Note that this patch should not change behavior but will be used in future
development: see bug 12758 or bug 12754.

Test plan:
Verify that behavior did not change in the following steps.
[1] Edit OPACXSLTResultsDisplay in order to use XSLT.
[2] Check search results page in OPAC.
[3] Edit OPACXSLTDetailsDisplay in order to use XSLT.
[4] Check detail page in OPAC.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall 2014-12-12 14:53:33 UTC
Created attachment 34354 [details] [review]
[PASSED QA] Bug 12973: Additional unit tests for XSLT_Handler.t

The additional way of parameter passing is tested in three additional
tests.

Test plan:
Verify if XSLT_Handler.t passes.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi 2015-01-18 13:26:00 UTC
Created attachment 35345 [details] [review]
Bug 12973: (QA followup) warnings are features, test them

This patch makes the test look for the warnings Koha::XSLT_Handler raises
instead of just throwing them to STDERR.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 10 Tomás Cohen Arazi 2015-01-18 13:53:51 UTC
Enhancement pushed to master.

Thanks Marcel!

PS Maybe we should fill a bug for removing to old API, as the new one makes a lot of sense and this patches don't target the stable branches.