Bug 23407 - XSLT Details pages don't use items, we shouldn't pass them
Summary: XSLT Details pages don't use items, we shouldn't pass them
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-31 20:14 UTC by Nick Clemens
Modified: 2022-06-08 06:24 UTC (History)
5 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:
20.05.00, 19.11.03, 19.05.08


Attachments
Bug 23407: Don't process items for XSLT on details pages (1.55 KB, patch)
2019-07-31 20:19 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23407: Don't process items for staff results either (1.15 KB, patch)
2019-08-01 18:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23407: Don't process items for XSLT on details pages (1.71 KB, patch)
2019-08-07 14:22 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23407: Don't process items for XSLT on details pages (1.77 KB, patch)
2020-01-24 00:13 UTC, Hayley Pelham
Details | Diff | Splinter Review
Bug 23407: Don't process items for XSLT on details pages (1.87 KB, patch)
2020-01-24 07:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23407: (QA follow-up) Remove some XSLT item leftovers (4.13 KB, patch)
2020-01-24 07:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT (3.24 KB, patch)
2020-01-24 07:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review

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