Bug 36370

Summary: Add ContentWarningField to UNIMARC XSLT
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: CatalogingAssignee: Fridolin Somers <fridolin.somers>
Status: Needs documenting --- QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, kyle, lucas, m.de.rooy, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement enables UNIMARC installations to pick a note field to use to store 'Content warnings' about bibliographic records, using the ContentWarningField system preference (added in Koha 23.05 by bug 31123, but only for MARC21 installations). To use this feature, add a tag and subfields to your bibliographic framework(s), and update the ContentWarningField system preference with the tag to use. A 'Content warning:' label will then be displayed in the OPAC and staff interface, on both the detail and results pages. If a $u subfield for a URL is added, the $a subfield will use this as to create a clickable link. Other subfields will be displayed after the $a subfield.
Version(s) released in:
24.05.00,23.11.06
Bug Depends on: 31123    
Bug Blocks:    
Attachments: Bug 36370: Add ContentWarningField to UNIMARC XSLT
Bug 36370: Add ContentWarningField to UNIMARC XSLT
Bug 36370: Add ContentWarningField to UNIMARC XSLT

Description Fridolin Somers 2024-03-20 14:22:16 UTC
Bug 31123 added new feature with preference ContentWarningField.
Add this behavior to UNMARC XSLT files.
Comment 1 Fridolin Somers 2024-03-20 15:10:22 UTC
Created attachment 163554 [details] [review]
Bug 36370: Add ContentWarningField to UNIMARC XSLT

Bug 31123 added new feature with preference ContentWarningField.
Add this behavior to UNMARC XSLT files.

This patch adds new template 'tag_content_warning' in UNIMARCslimUtils.xsl
called in results and details pages.

New field is placed after 3xx.

Test plan (in both interfaces OPAC and staff):
1) Create a new field 599 in framework
2) Set system preference ContentWarningField to 599
3) Edit a record to add a 599 with text in $a$b and an URL in $u
4) Perform a search to find this record
=> Check you see content_warning: <a href="$u">$a</a> $b
5) Click on details page
=> Check you see content_warning: <a href="$u">$a</a> $b
Comment 2 David Nind 2024-03-25 05:20:44 UTC
Created attachment 163764 [details] [review]
Bug 36370: Add ContentWarningField to UNIMARC XSLT

Bug 31123 added new feature with preference ContentWarningField.
Add this behavior to UNMARC XSLT files.

This patch adds new template 'tag_content_warning' in UNIMARCslimUtils.xsl
called in results and details pages.

New field is placed after 3xx.

Test plan (in both interfaces OPAC and staff):
1) Create a new field 599 in framework
2) Set system preference ContentWarningField to 599
3) Edit a record to add a 599 with text in $a$b and an URL in $u
4) Perform a search to find this record
=> Check you see content_warning: <a href="$u">$a</a> $b
5) Click on details page
=> Check you see content_warning: <a href="$u">$a</a> $b

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-03-25 05:42:18 UTC
Testing notes (using KTD):

1. Change the .env for KTD so that MARCFLAVOR=unimarc, and then start up KTD as normal

2. Edit a record so that all the required subfields are completed, and edit the item so that it has valid values and can be viewed in the OPAC.

3. I added a new 599 tag and added subfields for $a, $b, and #u (I use Test $a, Test $b, and URL as the subfield display names). 

4. I'm not sure what the recommend tag and subfields are for UNIMARC, so these will need to be added to the text for the release notes.
Comment 4 Kyle M Hall 2024-05-10 17:13:25 UTC
Created attachment 166588 [details] [review]
Bug 36370: Add ContentWarningField to UNIMARC XSLT

Bug 31123 added new feature with preference ContentWarningField.
Add this behavior to UNMARC XSLT files.

This patch adds new template 'tag_content_warning' in UNIMARCslimUtils.xsl
called in results and details pages.

New field is placed after 3xx.

Test plan (in both interfaces OPAC and staff):
1) Create a new field 599 in framework
2) Set system preference ContentWarningField to 599
3) Edit a record to add a 599 with text in $a$b and an URL in $u
4) Perform a search to find this record
=> Check you see content_warning: <a href="$u">$a</a> $b
5) Click on details page
=> Check you see content_warning: <a href="$u">$a</a> $b

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-05-13 12:02:26 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Martin Renvoize 2024-05-21 13:32:38 UTC
Awesome, thanks for following up here with UNIMARC support Fridolin :)
Comment 7 Fridolin Somers 2024-05-29 12:17:27 UTC
Nice small enhancement, I choose to backport

Pushed to 23.11.x for 23.11.06
Comment 8 Lucas Gass 2024-05-30 19:20:06 UTC
Enhancement will not be included in 23.05.x
Comment 9 Caroline Cyr La Rose 2024-07-11 16:22:11 UTC
I was looking at the manual to see if anything needed updating. The manual specifies that $x will not be displayed in the OPAC as it is considered an internal/non-public note. Is it the same for UNIMARC?

https://koha-community.org/manual/latest/en/html/catalogingpreferences.html#contentwarningfield