From 8160231758dbcdaed44620c8dff33f6631282dfa Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Aug 2025 16:01:35 +0100 Subject: [PATCH] Bug 34025: (QA follow-up) Fix subfield $t handling for 7XX contained works When 7XX fields contain both name ($a) and title ($t) subfields, the link should search for the title rather than the name. This is important for contained works that reference titles within larger works. This patch updates both intranet and OPAC XSLT files to check for the presence of subfield $t and use title search (ti,phr:) instead of author search (au:) when $t is present. Test plan: 1. Find or create a bibliographic record with 7XX fields containing both $a (name) and $t (title) subfields - For example: 700 $a Smith, John $t The Great Adventure 2. View the record detail page in both staff interface and OPAC 3. In the "Contained works" section, click on the link for the 7XX field entry 4. Verify the search is performed as a title search (ti,phr:"The Great Adventure") rather than author search (au:"Smith, John") 5. Confirm the search results show records matching the title from subfield $t 6. Test with records that have 7XX fields with only $a subfields to ensure they still search by author 7. Repeat testing for different 7XX field types (700, 710, 711) Signed-off-by: Lucas Gass (cherry picked from commit 3c72e5d9c588a035090a3078a07d05be6b305351) Signed-off-by: Jacob O'Mara --- .../en/xslt/MARC21slim2intranetDetail.xsl | 32 +++++++++++++------ .../en/xslt/MARC21slim2OPACDetail.xsl | 18 ++++++++--- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 000e556838..f86fdf6136 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -716,16 +716,28 @@ - /cgi-bin/koha/catalogue/search.pl?q=au:" - - " - - &sort_by= - - _ - - + + + + /cgi-bin/koha/catalogue/search.pl?q=ti,phr:" + + " + + + + /cgi-bin/koha/catalogue/search.pl?q=au:" + + " + + &sort_by= + + _ + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index d08575afc0..511d076258 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -825,10 +825,20 @@ - /cgi-bin/koha/opac-search.pl?q=au:" - - " + + + + /cgi-bin/koha/opac-search.pl?q=ti,phr:" + + " + + + + /cgi-bin/koha/opac-search.pl?q=au:" + + " + + &sort_by=