Bug 40300 - multiple semi-colons in series part name ($p)
Summary: multiple semi-colons in series part name ($p)
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 25.05
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-03 10:28 UTC by Bernard
Modified: 2025-07-03 16:27 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40300: Add chop punctuation to PartName () in Part xslt templates (2.06 KB, patch)
2025-07-03 10:34 UTC, Bernard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard 2025-07-03 10:28:22 UTC
In both intranet and OPAC full detail display an 830 series field which has a part $p displays multiple semi-colons if the field contains one. There is a part template which needs to use chopPunctuation.

1. Add series field 830 with 

$a Analecta Gregoriana, Series Facultatis Philosophiae.
$p Sectio B ;
$v n. 14.

2. Observe OPAC or intranet detail record:

Analecta Gregoriana, Series Facultatis Philosophiae. Sectio B ; ; n. 14.

3. Should be 

Analecta Gregoriana, Series Facultatis Philosophiae. Sectio B ; n. 14.
Comment 1 Bernard 2025-07-03 10:34:26 UTC
Created attachment 183742 [details] [review]
Bug 40300: Add chop punctuation to PartName () in Part xslt templates
Comment 2 Bernard 2025-07-03 10:36:55 UTC
1. Add series field 830 with 

$a Analecta Gregoriana, Series Facultatis Philosophiae.
$p Sectio B ;
$v n. 14.

2. Observe OPAC or intranet detail record:

Analecta Gregoriana, Series Facultatis Philosophiae. Sectio B ; ; n. 14.

3. Apply patch and restart_all

4. Observe OPAC or intranet detail record again - should be

Analecta Gregoriana, Series Facultatis Philosophiae. Sectio B ; n. 14.
Comment 3 Alexander Wagner 2025-07-03 16:27:51 UTC
Probably a bit philosophical: While I am personally all for removing punctuation from records and adding them automatically, I do wonder if in your case Koha is not entering a strange mixture. IMHO

- if a punctuation _is there_ the logic should be to keep and use it.
- if no punctuation is there it should add it.

IOW while I see what your code does and I also perfectly agree that having ` ; ; ` is wrong _and_ ugly, I do wonder why the ` ; ` in `|p` is different from the `.` in `|a` or `|v` and thus treated differently.

So, I think instead of chopping the punctuation from `|p` and add it again automatically, the code should look at leader 18 and decide if it should do anything wrt the punctuation in the first place. And if the leader says "all chars are there" it should just do nothing and leave it as is. (My guess would be your records states that it holds those chars.)

BTW: I started working on automatic punctuation in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21303. After playing around with XSLT and some discussion with Cait we came to the conclusion (which might be wrong) that it is probably _a lot_ easier to do this punctuation stuff by means of a Marc Filter in Perl especially as there are some complex things out there. Cf https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37196, https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37325 and their tests for examples and an implementation for a few fields.