Bug 24052

Summary: Koha::XSLT housekeeping for bug 23290 (follow-up)
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: 1joynelson, fridolin.somers, jonathan.druart, katrin.fischer, m.de.rooy, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on: 23290    
Bug Blocks:    
Attachments: Bug 24052: Rename XSLT_Handler
Bug 24052: Fix Koha/XSLT/Base.t
Bug 24052: Catch warning between test 6 and 7
Bug 24052: Add koha_xslt_security to koha-conf.xml
Bug 24052: Rename XSLT_Handler
Bug 24052: Fix Koha/XSLT/Base.t
Bug 24052: Catch warning between test 5 and 6
Bug 24052: Add koha_xslt_security to koha-conf.xml
Bug 24052: Rename XSLT_Handler
Bug 24052: Fix Koha/XSLT/Base.t
Bug 24052: Catch warning between test 5 and 6
Bug 24052: Add koha_xslt_security to koha-conf.xml
Bug 24052: Rename XSLT_Handler
Bug 24052: Fix Koha/XSLT/Base.t
Bug 24052: Catch warning between test 5 and 6
Bug 24052: Add koha_xslt_security to koha-conf.xml
Bug 24052: Rename XSLT_Handler
Bug 24052: Fix Koha/XSLT/Base.t
Bug 24052: Catch warning between test 5 and 6
Bug 24052: Add koha_xslt_security to koha-conf.xml

Comment 1 Marcel de Rooy 2020-01-27 13:47:22 UTC
> 2. Should not we have koha_xslt_security in etc/config.xml?
We do not need it at this moment. But I will post it to the subsequent report to add at least a commented entry.
Comment 2 Marcel de Rooy 2020-02-27 08:37:48 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2020-02-27 08:37:54 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2020-02-27 08:37:58 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2020-02-27 08:38:02 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2020-02-27 09:29:54 UTC
koha_1       | #   Failed test 'Remote import does not fail on read_net'
koha_1       | #   at t/db_dependent/Koha/XSLT/Security.t line 124.
koha_1       | # found warning: XSLT::Base: I/O warning : failed to load HTTP resource
koha_1       | # expected to find warning: (?^u:I/O warning : failed to load external entity)
koha_1       | # Looks like you failed 1 test of 7.
koha_1       | [21:53:52] t/db_dependent/Koha/XSLT/Security.tD8


Master D8 fails
t_db_dependent_Koha_XSLT_Security_t.Remote import does not fail on read_net (1450)

But Koha_19.11_D8 passes:
Remote import does not fail on read_net (47)
0.35 seconden
Passed
Triggered security callback for read_file (47)
1 ms
Passed
Triggered security callback for read_net (47)
1 ms
Passed
Triggered security callback for write_file (47)
1 ms
Passed
Triggered security callback for write_net (47)
1 ms
Passed
external entity did not get through (47)
0 ms
Passed
external entity got through (47)
Comment 7 Marcel de Rooy 2020-02-28 11:28:38 UTC
See bug 24756 first
Comment 8 Marcel de Rooy 2020-03-09 13:10:21 UTC
Created attachment 100371 [details] [review]
Bug 24052: Rename XSLT_Handler

Should be XSLT::Base now.
Removes old XSLT_Handler stub too (from bug 23290).
Result of a git grep | sed statement.

Test plan:
Run qa tools (so modules compile).
Run t/db_dependent/Breeding.t
Run t/db_dependent/Koha/XSLT/Base.t (This test fails when only this patch
has been applied; see subsequent patch.)
Enable XSLT use on results and details display. Check search results and
detail view on OPAC and staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2020-03-09 13:10:25 UTC
Created attachment 100372 [details] [review]
Bug 24052: Fix Koha/XSLT/Base.t

Moving the separate small attachments into the test script.
Creating them now as temporary files or code fragments.
Deleting original files.

Since Breeding.t also used one of these files, a similar change was made in
that script.

Test plan:
Run t/db_dependent/Koha/XSLT/Base.t. Should pass now.
Run t/db_dependent/Breeding.t again.
Git grep on XSLT_Handler. You should only find release notes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2020-03-09 13:10:29 UTC
Created attachment 100373 [details] [review]
Bug 24052: Catch warning between test 5 and 6

Resolve:
ok 5 - Engine returns error on undefined text
XSLT::Base: Empty String at /usr/share/koha/Koha/XSLT/Base.pm line 214.
ok 6 - Engine returns error on empty string

Test plan:
Run perl Base.t and verify that this warning is no longer printed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2020-03-09 13:10:34 UTC
Created attachment 100374 [details] [review]
Bug 24052: Add koha_xslt_security to koha-conf.xml

The line for enabling the unsafe expand_entities option is commented
and includes a warning to keep it like that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Owen Leonard 2020-03-09 17:40:10 UTC
Created attachment 100406 [details] [review]
Bug 24052: Rename XSLT_Handler

Should be XSLT::Base now.
Removes old XSLT_Handler stub too (from bug 23290).
Result of a git grep | sed statement.

Test plan:
Run qa tools (so modules compile).
Run t/db_dependent/Breeding.t
Run t/db_dependent/Koha/XSLT/Base.t (This test fails when only this patch
has been applied; see subsequent patch.)
Enable XSLT use on results and details display. Check search results and
detail view on OPAC and staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Owen Leonard 2020-03-09 17:40:13 UTC
Created attachment 100407 [details] [review]
Bug 24052: Fix Koha/XSLT/Base.t

Moving the separate small attachments into the test script.
Creating them now as temporary files or code fragments.
Deleting original files.

Since Breeding.t also used one of these files, a similar change was made in
that script.

Test plan:
Run t/db_dependent/Koha/XSLT/Base.t. Should pass now.
Run t/db_dependent/Breeding.t again.
Git grep on XSLT_Handler. You should only find release notes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Owen Leonard 2020-03-09 17:40:16 UTC
Created attachment 100408 [details] [review]
Bug 24052: Catch warning between test 5 and 6

Resolve:
ok 5 - Engine returns error on undefined text
XSLT::Base: Empty String at /usr/share/koha/Koha/XSLT/Base.pm line 214.
ok 6 - Engine returns error on empty string

Test plan:
Run perl Base.t and verify that this warning is no longer printed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 15 Owen Leonard 2020-03-09 17:40:19 UTC
Created attachment 100409 [details] [review]
Bug 24052: Add koha_xslt_security to koha-conf.xml

The line for enabling the unsafe expand_entities option is commented
and includes a warning to keep it like that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Marcel de Rooy 2020-03-09 21:14:47 UTC
Thx Owen !
Shall I add your signoff line or would you?
Comment 17 Marcel de Rooy 2020-03-10 12:40:02 UTC
Created attachment 100453 [details] [review]
Bug 24052: Rename XSLT_Handler

Should be XSLT::Base now.
Removes old XSLT_Handler stub too (from bug 23290).
Result of a git grep | sed statement.

Test plan:
Run qa tools (so modules compile).
Run t/db_dependent/Breeding.t
Run t/db_dependent/Koha/XSLT/Base.t (This test fails when only this patch
has been applied; see subsequent patch.)
Enable XSLT use on results and details display. Check search results and
detail view on OPAC and staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 18 Marcel de Rooy 2020-03-10 12:40:07 UTC
Created attachment 100454 [details] [review]
Bug 24052: Fix Koha/XSLT/Base.t

Moving the separate small attachments into the test script.
Creating them now as temporary files or code fragments.
Deleting original files.

Since Breeding.t also used one of these files, a similar change was made in
that script.

Test plan:
Run t/db_dependent/Koha/XSLT/Base.t. Should pass now.
Run t/db_dependent/Breeding.t again.
Git grep on XSLT_Handler. You should only find release notes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 19 Marcel de Rooy 2020-03-10 12:40:11 UTC
Created attachment 100455 [details] [review]
Bug 24052: Catch warning between test 5 and 6

Resolve:
ok 5 - Engine returns error on undefined text
XSLT::Base: Empty String at /usr/share/koha/Koha/XSLT/Base.pm line 214.
ok 6 - Engine returns error on empty string

Test plan:
Run perl Base.t and verify that this warning is no longer printed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 20 Marcel de Rooy 2020-03-10 12:40:15 UTC
Created attachment 100456 [details] [review]
Bug 24052: Add koha_xslt_security to koha-conf.xml

The line for enabling the unsafe expand_entities option is commented
and includes a warning to keep it like that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 21 Marcel de Rooy 2020-03-10 12:40:42 UTC
(In reply to Marcel de Rooy from comment #16)
> Thx Owen !
> Shall I add your signoff line or would you?

Fixed
Comment 22 Kyle M Hall 2020-03-20 14:33:05 UTC
Created attachment 101118 [details] [review]
Bug 24052: Rename XSLT_Handler

Should be XSLT::Base now.
Removes old XSLT_Handler stub too (from bug 23290).
Result of a git grep | sed statement.

Test plan:
Run qa tools (so modules compile).
Run t/db_dependent/Breeding.t
Run t/db_dependent/Koha/XSLT/Base.t (This test fails when only this patch
has been applied; see subsequent patch.)
Enable XSLT use on results and details display. Check search results and
detail view on OPAC and staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Kyle M Hall 2020-03-20 14:33:14 UTC
Created attachment 101119 [details] [review]
Bug 24052: Fix Koha/XSLT/Base.t

Moving the separate small attachments into the test script.
Creating them now as temporary files or code fragments.
Deleting original files.

Since Breeding.t also used one of these files, a similar change was made in
that script.

Test plan:
Run t/db_dependent/Koha/XSLT/Base.t. Should pass now.
Run t/db_dependent/Breeding.t again.
Git grep on XSLT_Handler. You should only find release notes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Kyle M Hall 2020-03-20 14:33:17 UTC
Created attachment 101120 [details] [review]
Bug 24052: Catch warning between test 5 and 6

Resolve:
ok 5 - Engine returns error on undefined text
XSLT::Base: Empty String at /usr/share/koha/Koha/XSLT/Base.pm line 214.
ok 6 - Engine returns error on empty string

Test plan:
Run perl Base.t and verify that this warning is no longer printed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 25 Kyle M Hall 2020-03-20 14:33:19 UTC
Created attachment 101121 [details] [review]
Bug 24052: Add koha_xslt_security to koha-conf.xml

The line for enabling the unsafe expand_entities option is commented
and includes a warning to keep it like that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 26 Martin Renvoize 2020-03-24 10:42:43 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 27 Joy Nelson 2020-04-03 21:36:38 UTC
enhancement not backported to 19.11.x