Bugzilla – Attachment 185832 Details for
Bug 34025
Uniform titles (130 / 240 /730) in biblio to link to authority file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34025: (follow-up) Fix subfield $t handling for 7XX contained works
Bug-34025-follow-up-Fix-subfield-t-handling-for-7X.patch (text/plain), 6.93 KB, created by
Martin Renvoize (ashimema)
on 2025-08-27 15:05:23 UTC
(
hide
)
Description:
Bug 34025: (follow-up) Fix subfield $t handling for 7XX contained works
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-08-27 15:05:23 UTC
Size:
6.93 KB
patch
obsolete
>From 3babcdb16b088b73d1a917bf81bbb56e32f1e37f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >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 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=au:"</xsl:text> >- <xsl:value-of >- select="str:encode-uri(marc:subfield[@code='a'], true())" /> >- <xsl:text>"</xsl:text> >- <xsl:if test="$AuthorLinkSortBy!='default'"> >- <xsl:text>&sort_by=</xsl:text> >- <xsl:value-of select="$AuthorLinkSortBy" /> >- <xsl:text>_</xsl:text> >- <xsl:value-of select="$AuthorLinkSortOrder" /> >- </xsl:if> >+ <xsl:choose> >+ <!-- If there's a $t subfield, treat as a title search --> >+ <xsl:when test="marc:subfield[@code='t']"> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=ti,phr:"</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code='t'], true())" /> >+ <xsl:text>"</xsl:text> >+ </xsl:when> >+ <!-- Otherwise treat as an author search --> >+ <xsl:otherwise> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=au:"</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code='a'], true())" /> >+ <xsl:text>"</xsl:text> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:attribute> > </xsl:otherwise> > </xsl:choose> >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 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:"</xsl:text> >- <xsl:value-of >- select="str:encode-uri(marc:subfield[@code='a'], true())" /> >- <xsl:text>"</xsl:text> >+ <xsl:choose> >+ <!-- If there's a $t subfield, treat as a title search --> >+ <xsl:when test="marc:subfield[@code='t']"> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=ti,phr:"</xsl:text> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())" /> >+ <xsl:text>"</xsl:text> >+ </xsl:when> >+ <!-- Otherwise treat as an author search --> >+ <xsl:otherwise> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:"</xsl:text> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())" /> >+ <xsl:text>"</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> > <xsl:if test="$AuthorLinkSortBy!='default'"> > <xsl:text>&sort_by=</xsl:text> > <xsl:value-of select="$AuthorLinkSortBy" /> >-- >2.51.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34025
:
152389
|
180475
|
180681
|
183702
|
183703
|
183704
|
184151
|
185830
|
185831
| 185832