| Summary: | MARC21slim2MODS.xsl broken by duplicate template name "part" | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Owen Leonard <oleonard> |
| Component: | OPAC | Assignee: | Owen Leonard <oleonard> |
| Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | andrew, david, fridolin.somers, jonathan.druart, kyle, m.de.rooy, victor |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29629 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: |
This fixes an error when making an unAPI request in the OPAC using the MODS format. A 500 page error was displayed instead of an XML file. Example URL: http://your-library-opac-domain/cgi-bin/koha/unapi?id=koha:biblionumber:1&format=MODS
|
Version(s) released in: |
22.05.00,21.11.01,21.05.08
|
| Circulation function: | |||
| Bug Depends on: | 5927 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part"
Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part" Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part" |
||
|
Description
Owen Leonard
2021-11-22 14:55:18 UTC
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. |