Bug 18540: (QA follow-up) Only mention index_sort_title if defined

This patch makes the generated xslt not mention index_sort_title unless
the entry is defined on the xml file. Otherwise there's a call to

<xslo:apply-templates mode="index_sort_title"/>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Tomás Cohen Arazi 2022-01-07 10:44:30 -03:00 committed by Fridolin Somers
parent 78d403ca3d
commit 75514a85c5

View file

@ -19,7 +19,7 @@
<xsl:key name="index_data_field_tag" match="kohaidx:index_data_field" use="@tag"/>
<xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
<xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
<xsl:key name="index_sort_title_tag" match="kohaidx:index_sort_title" use="@tag"/>
<xsl:key name="index_sort_title_tag" match="kohaidx:index_sort_title" use="@tag"/>
<xsl:template match="kohaidx:index_defs">
<xsl:comment>
@ -40,7 +40,9 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
<xslo:template match="text()" mode="index_heading_conditional"/>
<xslo:template match="text()" mode="index_match_heading"/>
<xslo:template match="text()" mode="index_subject_thesaurus"/>
<xsl:if test="//kohaidx:index_sort_title">
<xslo:template match="text()" mode="index_sort_title"/>
</xsl:if>
<xslo:template match="/">
<xslo:if test="marc:collection">
<collection>
@ -67,7 +69,9 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
<xslo:apply-templates mode="index_match_heading"/>
<xslo:apply-templates mode="index_subject_thesaurus"/>
<xslo:apply-templates mode="index_all"/>
<xsl:if test="//kohaidx:index_sort_title">
<xslo:apply-templates mode="index_sort_title"/>
</xsl:if>
</z:record>
</xslo:template>