From 3babcdb16b088b73d1a917bf81bbb56e32f1e37f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Aug 2025 16:01:35 +0100 Subject: [PATCH] Bug 34025: (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) --- .../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 d734466bed4..161e2fecc9a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -670,16 +670,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 732a4431db0..2d087336733 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -786,10 +786,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= -- 2.51.0