Bug 25082: Make 041 descriptions display, if authorised value list is used
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 12 Apr 2020 16:30:05 +0000 (16:30 +0000)
committerJoy Nelson <joy@bywatersolutions.com>
Mon, 11 May 2020 22:00:21 +0000 (22:00 +0000)
commita53d63e0f7720321715e75be1147d8ea4df9a3aa
treea196a4e5ba2feb91b001cc14ac8706b91b5a2e41
parent75e7861df4834d7172b55552d1b7a03d3ab3b537
Bug 25082: Make 041 descriptions display, if authorised value list is used

When 041$a or another subfield is linked to an authorised value list,
Koha will replace the codes with the descriptions from the authorised
value in the MARCXML before passing it to the XSLT.

The XSLT was made to translate codes into descriptions - as there is
no code now, this fails and 'unknown language' is shown.

The patch changes the handling so that when the XSLT is handled something
that doesn't match a known code, it displays the subfield without
processing.

To test:
- Create some records with 041.
  Examples: http://www.loc.gov/marc/bibliographic/bd041.html
- Verify this displays nicely in staff and OPAC
- Apply patch
- Verify display is unchanged
- Remove the patch
- Change one of your MARC frameworks (use another framework than
  for your first test records)
  and link the 041 subfields to the LANG authorised value list
- Go to administration and create some entries for LANG with language
  codes and descriptions
- Catalog a 041 using the normal editor (not advanced)
- You can now use a pull down to select the values you want
- Verify the display is now 'Unknown language' for this record
- Apply patch
- Verify all records display the language descriptions now, using
  an authorised value or not
- Run misc/maintenance/generate_MARC21Languages.pl

Verify the output at the end reads like:
<xsl:otherwise>
    <!-- when 041\$a is mapped to an authorised value list, this will show the description -->
    <xsl:value-of select="\$code" />
</xsl:otherwise>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21Languages.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21Languages.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl
misc/maintenance/generate_MARC21Languages.pl