Bug 36370 - Add ContentWarningField to UNIMARC XSLT
Summary: Add ContentWarningField to UNIMARC XSLT
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 31123
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-20 14:22 UTC by Fridolin Somers
Modified: 2024-05-30 19:20 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 36370: Add ContentWarningField to UNIMARC XSLT (10.15 KB, patch)
2024-03-20 15:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 36370: Add ContentWarningField to UNIMARC XSLT (10.20 KB, patch)
2024-03-25 05:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 36370: Add ContentWarningField to UNIMARC XSLT (10.26 KB, patch)
2024-05-10 17:13 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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