Bug 5927, "Show series information in search results page" made a change to MARC21slimUtils.xsl, adding a block starting like this: <xsl:template name="part"> ...this breaks UNAPI in the OPAC when using MODS format because MARC21slim2MODS.xsl, which imports MARC21slimUtils.xsl, also includes the same block. Removing the redundant section from MARC21slim2MODS.xsl should fix the error.
Created attachment 127933 [details] [review] Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part" This patch removes a redundant section from MARC21slim2MODS.xsl which was breaking the option to use unAPI in the OPAC using MODS format. To test, apply the patch and view a record in the OPAC using unAPI, e.g.: /cgi-bin/koha/unapi?id=koha:biblionumber:1&format=MODS You should see an XML file where previously there would have been an error.
Created attachment 128014 [details] [review] Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part" This patch removes a redundant section from MARC21slim2MODS.xsl which was breaking the option to use unAPI in the OPAC using MODS format. To test, apply the patch and view a record in the OPAC using unAPI, e.g.: /cgi-bin/koha/unapi?id=koha:biblionumber:1&format=MODS You should see an XML file where previously there would have been an error. Signed-off-by: David Nind <david@davidnind.com>
Resolves: [2021/11/26 08:51:19] [WARN] XSLT::Base: compilation error: file /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS.xsl element template xsl:template: error duplicate name 'part' at /usr/share/koha/Koha/XSLT/Base.pm line 342.
Created attachment 128028 [details] [review] Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part" This patch removes a redundant section from MARC21slim2MODS.xsl which was breaking the option to use unAPI in the OPAC using MODS format. To test, apply the patch and view a record in the OPAC using unAPI, e.g.: /cgi-bin/koha/unapi?id=koha:biblionumber:1&format=MODS You should see an XML file where previously there would have been an error. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
What about: git grep 'xsl:template name="part"' [11:13:29] koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MADS.xsl: <xsl:template name="part"> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl: <xsl:template name="part"> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl: <xsl:template name="part"> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl: <xsl:template name="part"> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl: <xsl:template name="part"> koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl: <xsl:template name="part"> koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl: <xsl:template name="part"> koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl: <xsl:template name="part"> % grep slimUtils koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MADS.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MADS.xsl: <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl: <xsl:include href="MARC21slimUtils-MODS31.xsl"/> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl: <xsl:include href="MARC21slimUtils.xsl"/> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl: <xsl:include href="MARC21slimUtils.xsl"/> koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl:<xsl:import href="UNIMARCslimUtils.xsl"/> koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl:<xsl:import href="UNIMARCslimUtils.xsl"/>
> koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MADS.xsl This seems to be an authority record export format which can be tested by viewing an authority in the staff interface and choosing Save -> MADS. The export appears to work correctly. > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl This seems to be a bibliographic record export format which can be tested by viewing a bibliographic record in the staff interface and choosing Save -> MODS. The export appears to work correctly. > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl These two files appear to be unused. I could only find references to them in .po files.
Pushed to master for 22.05, thanks to everybody involved!
Jonathan: Here is what makes the difference (yes it is confusing at least): MARC21slim2MODS.xsl contains <xsl:include href="MARC21slimUtils.xsl"/> This is our include that contains the template named part. But MARC21slim2MADS.xsl contains <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/> This is NOT our include, but the LOC one. And it does not include a template named part. Etc.
(In reply to Owen Leonard from comment #6) > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MADS.xsl > > This seems to be an authority record export format which can be tested by > viewing an authority in the staff interface and choosing Save -> MADS. The > export appears to work correctly. > > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl > > This seems to be a bibliographic record export format which can be tested by > viewing a bibliographic record in the staff interface and choosing Save -> > MODS. The export appears to work correctly. > > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl > > These two files appear to be unused. I could only find references to them in > .po files. Thanks for checking. See former comment too.
What does not help either, is that opac/unapi runs INTRANET xslt sheets: sub get_xslt_file { my ($format, $format_to_stylesheet_map, $format_info) = @_; $format = lc $format; my $marcflavour = uc(C4::Context->preference('marcflavour')); return unless $format_to_stylesheet_map->{$marcflavour}->{$format}; my $xslt_file = C4::Context->config('intrahtdocs') . "/prog/en/xslt/" . $format_to_stylesheet_map->{$marcflavour}->{$format};
(In reply to Owen Leonard from comment #6) > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3.xsl > > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS32.xsl > > These two files appear to be unused. I could only find references to them in > .po files. Lets remove them on bug 29629.
Pushed to 21.11.x for 21.11.01
Pushed to 21.05.x for 21.05.08
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.