Bug 23407

Summary: XSLT Details pages don't use items, we shouldn't pass them
Product: Koha Reporter: Nick Clemens <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: 1joynelson, fridolin.somers, hayleypelham, lucas, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23414
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28373
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08
Attachments: Bug 23407: Don't process items for XSLT on details pages
Bug 23407: Don't process items for staff results either
Bug 23407: Don't process items for XSLT on details pages
Bug 23407: Don't process items for XSLT on details pages
Bug 23407: Don't process items for XSLT on details pages
Bug 23407: (QA follow-up) Remove some XSLT item leftovers
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT

Description Nick Clemens 2019-07-31 20:14:27 UTC
C4::XSLT::XSLTParse4Display calls buildKohaItemsNamespace() for all displays

For IntranetDetails and OPACDetails there is no item processing.

Removing this call can save us time
Comment 1 Nick Clemens 2019-07-31 20:19:26 UTC
Created attachment 91900 [details] [review]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note th eload time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information
Comment 2 Nick Clemens 2019-08-01 18:47:31 UTC
Created attachment 91916 [details] [review]
Bug 23407: Don't process items for staff results either

We also don't use the items here, same test plan but on staff cleint results, should see no change
Comment 3 Owen Leonard 2019-08-04 16:58:11 UTC
This worked as advertised but I got this warning from the qa tool:

 FAIL	C4/XSLT.pm
   FAIL	  critic
		# Variables::ProhibitConditionalDeclarations: Got 1 violation(s).
Comment 4 Nick Clemens 2019-08-07 14:22:41 UTC
Created attachment 92045 [details] [review]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information
Comment 5 Hayley Pelham 2020-01-24 00:13:56 UTC
Created attachment 97850 [details] [review]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Comment 6 Marcel de Rooy 2020-01-24 07:09:41 UTC
QA: Looking here


> QA can grep the standard XSLT files for details pages for 'item' to note
> occurences do not use items information

intranetResults

  xmlns:items="http://www.koha-community.org/items"
  exclude-result-prefixes="marc items str">
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
    <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
        <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>

still a few lines in intranetDetails too

Removed in a follow-up
Comment 7 Marcel de Rooy 2020-01-24 07:25:22 UTC
Created attachment 97854 [details] [review]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2020-01-24 07:25:26 UTC
Created attachment 97855 [details] [review]
Bug 23407: (QA follow-up) Remove some XSLT item leftovers

Test plan:
Check intranet results and detail page.
Check opac detail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2020-01-24 07:25:30 UTC
Created attachment 97856 [details] [review]
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Martin Renvoize 2020-01-24 15:21:08 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-02-10 22:01:23 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 12 Lucas Gass 2020-02-14 17:42:24 UTC
backported to 19.05.x for 19.05.08
Comment 13 Hayley Pelham 2020-02-17 01:55:34 UTC
Enhancement will not be backported to 18.11.x series.