Bug 12973 - Allow passing code to XSLT_Handler instead of filename
Summary: Allow passing code to XSLT_Handler instead of filename
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 12754 12758
  Show dependency treegraph
 
Reported: 2014-09-20 07:58 UTC by Marcel de Rooy
Modified: 2016-06-21 21:36 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12973: Allow passing code to XSLT_Handler instead of filename (6.48 KB, patch)
2014-09-25 09:37 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 12973: Additional unit tests for XSLT_Handler.t (1.99 KB, patch)
2014-09-25 09:37 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[Signed Off] Bug 12973: Allow passing code to XSLT_Handler instead of filename (6.52 KB, patch)
2014-11-14 09:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
[Signed Off] Bug 12973: Additional unit tests for XSLT_Handler.t (2.03 KB, patch)
2014-11-14 09:13 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 12973: Allow passing code to XSLT_Handler instead of filename (6.57 KB, patch)
2014-12-12 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 12973: Allow passing code to XSLT_Handler instead of filename (6.57 KB, patch)
2014-12-12 14:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 12973: Additional unit tests for XSLT_Handler.t (2.08 KB, patch)
2014-12-12 14:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12973: (QA followup) warnings are features, test them (5.04 KB, patch)
2015-01-18 13:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.