Bug 29606 - Include items from host record in XML for XSLT processing
Summary: Include items from host record in XML for XSLT processing
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-01 08:01 UTC by Julian Maurice
Modified: 2022-09-25 23:35 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 29606: Include items from host record in XML for XSLT processing (3.57 KB, patch)
2021-12-01 08:02 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 29606: Include items from host record in XML for XSLT processing (3.62 KB, patch)
2022-07-09 21:39 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2021-12-01 08:01:55 UTC
If EasyAnalyticalRecords is enabled, items from host records should be included in the XML. Otherwise, OPAC search results show no items.
Comment 1 Julian Maurice 2021-12-01 08:02:27 UTC
Created attachment 128118 [details] [review]
Bug 29606: Include items from host record in XML for XSLT processing

If EasyAnalyticalRecords is enabled, items from host records should be
included in the XML. Otherwise, OPAC search results show no items.

Test plan:
0. Do not apply the patch yet
1. Enable syspref EasyAnalyticalRecords and set OPACXSLTResultsDisplay
   to 'default'
2. Create a biblio record with title "parent" and create an item with a
   barcode for this biblio
3. Create a biblio record with title "child" with no items. On the
   biblio detail page, in the toolbar, click "Edit -> Link to host
   record" and enter the barcode for the item you created at step 2
4. Duplicate this biblio record, to be sure you will have at least two
   results with the search "child" (and not be redirected to the detail
   page)
5. Make sure your search index (zebra or elasticsearch) is up to date
6. Go to OPAC and search "child".
   You should see two results, no items.
   Click on one of them. On the detail page you should see one item (the
   one from the host record)
7. Apply the patch
8. Go to OPAC and search "child".
   You should now see one item (the same item) for each result.
Comment 2 David Nind 2022-07-09 21:39:52 UTC
Created attachment 137450 [details] [review]
Bug 29606: Include items from host record in XML for XSLT processing

If EasyAnalyticalRecords is enabled, items from host records should be
included in the XML. Otherwise, OPAC search results show no items.

Test plan:
0. Do not apply the patch yet
1. Enable syspref EasyAnalyticalRecords and set OPACXSLTResultsDisplay
   to 'default'
2. Create a biblio record with title "parent" and create an item with a
   barcode for this biblio
3. Create a biblio record with title "child" with no items. On the
   biblio detail page, in the toolbar, click "Edit -> Link to host
   record" and enter the barcode for the item you created at step 2
4. Duplicate this biblio record, to be sure you will have at least two
   results with the search "child" (and not be redirected to the detail
   page)
5. Make sure your search index (zebra or elasticsearch) is up to date
6. Go to OPAC and search "child".
   You should see two results, no items.
   Click on one of them. On the detail page you should see one item (the
   one from the host record)
7. Apply the patch
8. Go to OPAC and search "child".
   You should now see one item (the same item) for each result.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Kyle M Hall 2022-09-23 16:08:47 UTC
Can you add a unit test for the change to buildKohaItemsNamespace?
Comment 4 David Cook 2022-09-25 23:34:33 UTC
This could slow down the (already slow) search results a lot...
Comment 5 David Cook 2022-09-25 23:35:38 UTC
At a minimum, I'd say this should be wrapped in a system preference.