Bug 30554

Summary: Use XSLT in authority search cataloguing plugin
Product: Koha Reporter: Jérémy Breuillard <jeremy.breuillard>
Component: CatalogingAssignee: Julian Maurice <julian.maurice>
Status: Pushed to main --- QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: david, janet.mcgowan, jeremy.breuillard, julian.maurice, m.de.rooy, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32512
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the authority search cataloguing plugin so that the search results when adding an authority term to a record are customisable when using the AuthorityXSLTResultsDisplay system preference (for both MARC21 and UNIMARC).
Version(s) released in:
24.05.00
Bug Depends on: 11083    
Bug Blocks:    
Attachments: Bug 30554: Wrong display of authorities records in the Authority search plugin
Very simple XSLT for testing purposes (works with MARC21 and UNIMARC)
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin
Screenshots - before and after patch applied
Screenshots - before and after patch applied
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin
Bug 30554: Embelished MARC21 XSLT example
Bug 30554: Embelished MARC21 XSLT example

Description Jérémy Breuillard 2022-04-15 15:31:55 UTC
Once the search is done with this plugin some of the authorities are wrong displayed because parts and links are missing. It is not the case if the search is made via authority mobile
Comment 1 Jérémy Breuillard 2022-04-15 15:34:03 UTC
Created attachment 133359 [details] [review]
Bug 30554: Wrong display of authorities records in the Authority search plugin

With this patch the display of the authorities records is available at XSLT format

Test plan:
1)Make sure to have at least one Authority Type defined
2)Home > Cataloging > New record > tab.7 Field 700$a
3)Click on the Tag editor button
4)Click on Search button and notice the displaying of the results
5)Apply patch and repeat 3) and 4)
6)The results are now displayed at XSLT format
Comment 2 Owen Leonard 2022-05-11 12:02:31 UTC
Doesn't apply:

Applying: MT 36361: Wrong display of authorities records in the Authority search plugin
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt).
error: could not build fake ancestor
Patch failed at 0001 MT 36361: Wrong display of authorities records in the Authority search plugin
Comment 3 Julian Maurice 2023-10-11 14:19:58 UTC
Created attachment 156824 [details]
Very simple XSLT for testing purposes (works with MARC21 and UNIMARC)
Comment 4 Julian Maurice 2023-10-11 14:23:28 UTC
Created attachment 156825 [details] [review]
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin

Test plan:
1. Set AuthorityXSLTResultsDisplay to a valid XSL file (see bug 30554
   attachments, there is an example XSL file)
2. Go to the bibliographic record editor (edit an existing one or create
   a new one)
3. Find a field linked to authorities and open the plugin
4. Start a search and verify that the results are displayed using the
   XSLT output (if using the example file it should be a link saying
   "Authority #<authid>")
Comment 5 Julian Maurice 2023-10-11 14:25:14 UTC
Created attachment 156826 [details] [review]
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin

Test plan:
1. Set AuthorityXSLTResultsDisplay to a valid XSL file (see bug 30554
   attachments, there is an example XSL file)
2. Go to the bibliographic record editor (edit an existing one or create
   a new one)
3. Find a field linked to authorities and open the plugin
4. Start a search and verify that the results are displayed using the
   XSLT output (if using the example file it should be a link saying
   "Authority #<authid>")

Sponsored-by: Écoles nationales supérieure d'architecture (ENSA)
Comment 6 David Nind 2023-10-17 23:15:41 UTC
Created attachment 157293 [details] [review]
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin

Test plan:
1. Set AuthorityXSLTResultsDisplay to a valid XSL file (see bug 30554
   attachments, there is an example XSL file)
2. Go to the bibliographic record editor (edit an existing one or create
   a new one)
3. Find a field linked to authorities and open the plugin
4. Start a search and verify that the results are displayed using the
   XSLT output (if using the example file it should be a link saying
   "Authority #<authid>")

Sponsored-by: Écoles nationales supérieure d'architecture (ENSA)
Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-10-17 23:36:44 UTC
Created attachment 157294 [details]
Screenshots - before and after patch applied

Testing notes (using KTD):

1. Edit any record (for example, CGI programming with Perl).

2. Add another topical term in 650$a (repeat the tag, click on the tag editor, click search).

3. Default search results format is displayed (see attachment).

4. Apply the patch and restart_all.

5. Save the simple record attached to the bug to somewhere like /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthorityXSLTResultsDisplay.xsl

6. Update the AuthorityXSLTResultsDisplay system preference with this path.

7. Repeat steps 1-2.

8. Note that the search results are displayed using the custom XSLT file (see attachment).

Note: Only tested on a MARC21 instance.
Comment 8 David Nind 2023-10-17 23:39:07 UTC Comment hidden (obsolete)
Comment 9 David Nind 2023-10-17 23:39:54 UTC
Created attachment 157295 [details]
Screenshots - before and after patch applied

Screenshot of search results - before and after the patch is applied.
Comment 10 Martin Renvoize 2024-01-26 12:45:32 UTC
Created attachment 161517 [details] [review]
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin

Test plan:
1. Set AuthorityXSLTResultsDisplay to a valid XSL file (see bug 30554
   attachments, there is an example XSL file)
2. Go to the bibliographic record editor (edit an existing one or create
   a new one)
3. Find a field linked to authorities and open the plugin
4. Start a search and verify that the results are displayed using the
   XSLT output (if using the example file it should be a link saying
   "Authority #<authid>")

Sponsored-by: Écoles nationales supérieure d'architecture (ENSA)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2024-01-26 12:45:35 UTC Comment hidden (obsolete)
Comment 12 Martin Renvoize 2024-01-26 12:54:26 UTC
There are no regressions caused by this, though I'd love to have a much more comprehensive example XSLT that at least mimicked the existing non-xslt display.

I've started that task, but my MARC21 isn't entirely up to the task and I'd appreciate some help getting that done.

However.. I do think we can Pass QA as is to get the foundations of the feature in.. at a future point I'd like to remove the non-xslt view and just replace it with this as we have done for biblio displays.
Comment 13 Martin Renvoize 2024-01-26 15:19:26 UTC Comment hidden (obsolete)
Comment 14 Martin Renvoize 2024-01-27 19:02:42 UTC
*** Bug 32512 has been marked as a duplicate of this bug. ***
Comment 15 Katrin Fischer 2024-03-22 14:48:09 UTC
Pushed for 24.05!

Well done everyone, thank you!