Bug 41060 - Add a value_builder to check if ISSN is valid
Summary: Add a value_builder to check if ISSN is valid
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Arthur Suzuki
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-21 08:53 UTC by Arthur Suzuki
Modified: 2026-01-22 17:04 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds a new cataloging plugin (value builder) for validating ISSNs. If you enter an invalid ISSN, a browser pop-up window warns that the ISSN is invalid, but you can ignore this (the field is highlighted in yellow) and still save the record. For new installations, the validate_issn.pl plugin is added to the bibliographic frameworks by default for 022$a (MARC21) or 011$a (UNIMARC). For existing installations, update your frameworks manually.
Version(s) released in:
26.05.00
Circulation function:


Attachments
Bug 41060: Add a cataloguing plugin to check ISSN (4.70 KB, patch)
2025-10-21 08:55 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 41060: Add a cataloguing plugin to check ISSN (4.76 KB, patch)
2025-10-24 16:04 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) improve ISSN format detection (1.17 KB, patch)
2026-01-06 12:44 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) improve ISSN format detection (1.18 KB, patch)
2026-01-06 12:48 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 41060: Add a cataloguing plugin to check ISSN (4.80 KB, patch)
2026-01-06 17:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) improve ISSN format detection (1.22 KB, patch)
2026-01-06 17:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 41060: Add a cataloguing plugin to check ISSN (4.90 KB, patch)
2026-01-16 10:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) improve ISSN format detection (1.32 KB, patch)
2026-01-16 10:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) Check in change, trigger once in Blur (3.23 KB, patch)
2026-01-16 10:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41060: (QA follow-up) Consistent return for empty string (1.13 KB, patch)
2026-01-16 10:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Suzuki 2025-10-21 08:53:58 UTC
same as Bug29980 but for ISSN.
Comment 1 Arthur Suzuki 2025-10-21 08:55:45 UTC
Created attachment 188200 [details] [review]
Bug 41060: Add a cataloguing plugin to check ISSN

Test plan:
- without patch login to Koha
- edit a biblio and put a wrong ISSN in 022a (011a for unimarc).
- leave the input field (looses focus), no warning
- apply patch and do "reset_all" to make a full re-install.
- edit the biblio again and put an invalid ISSN in 022a (011a for unimarc).
- when you leave the input field you should have a warning saying "invalid ISSN".
- the input field should turn yellow
- you can still save the biblio with a wrong issn, it is just a warning.
- if you apply the patch on an existing install, you must manually link the value builder to your existing frameworks to get it working.
Comment 2 Owen Leonard 2025-10-24 16:04:15 UTC
Created attachment 188418 [details] [review]
Bug 41060: Add a cataloguing plugin to check ISSN

Test plan:
- without patch login to Koha
- edit a biblio and put a wrong ISSN in 022a (011a for unimarc).
- leave the input field (looses focus), no warning
- apply patch and do "reset_all" to make a full re-install.
- edit the biblio again and put an invalid ISSN in 022a (011a for unimarc).
- when you leave the input field you should have a warning saying
  "invalid ISSN".
- the input field should turn yellow
- you can still save the biblio with a wrong issn, it is just a warning.
- if you apply the patch on an existing install, you must manually link
  the value builder to your existing frameworks to get it working.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Marcel de Rooy 2025-10-31 10:41:27 UTC
Some observations:

If I leave 022 empty, there is a warn about invalid ISSN. Thats weird. Please fix.

If I enter a valid ISSN like 1234-5679, it is ok. If I enter 1234-5679A, it is ok too and that is confusing. If I enter 1234-5679X, it is wrong.
Coming from Business::ISSN. So out of scope ?
Comment 4 Arthur Suzuki 2026-01-06 12:44:36 UTC
Created attachment 190929 [details] [review]
Bug 41060: (QA follow-up) improve ISSN format detection

Two tests have been added:
- not only the checksum of the ISSN is checked but also the format.
- if the ISSN is left empty, the plugin won't give a warning.
Comment 5 Arthur Suzuki 2026-01-06 12:48:02 UTC
Created attachment 190930 [details] [review]
Bug 41060: (QA follow-up) improve ISSN format detection

Two tests have been added:
- not only the checksum of the ISSN is checked but also the format.
- if the ISSN is left empty, the plugin won't give a warning.
Comment 6 Arthur Suzuki 2026-01-06 12:48:23 UTC
(In reply to Marcel de Rooy from comment #3)
> Some observations:
> 
> If I leave 022 empty, there is a warn about invalid ISSN. Thats weird.
> Please fix.
> 
> If I enter a valid ISSN like 1234-5679, it is ok. If I enter 1234-5679A, it
> is ok too and that is confusing. If I enter 1234-5679X, it is wrong.
> Coming from Business::ISSN. So out of scope ?

Hi Marcel,
The latest patch should fix all the point you mentionned, I've added some controls and a regexp to check the format :)
qa scripts are ha
Happy new year!
Arthur
Comment 7 David Nind 2026-01-06 17:14:42 UTC
Created attachment 190943 [details] [review]
Bug 41060: Add a cataloguing plugin to check ISSN

Test plan:
- without patch login to Koha
- edit a biblio and put a wrong ISSN in 022a (011a for unimarc).
- leave the input field (looses focus), no warning
- apply patch and do "reset_all" to make a full re-install.
- edit the biblio again and put an invalid ISSN in 022a (011a for unimarc).
- when you leave the input field you should have a warning saying
  "invalid ISSN".
- the input field should turn yellow
- you can still save the biblio with a wrong issn, it is just a warning.
- if you apply the patch on an existing install, you must manually link
  the value builder to your existing frameworks to get it working.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2026-01-06 17:14:46 UTC
Created attachment 190944 [details] [review]
Bug 41060: (QA follow-up) improve ISSN format detection

Two tests have been added:
- not only the checksum of the ISSN is checked but also the format.
- if the ISSN is left empty, the plugin won't give a warning.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2026-01-06 17:21:35 UTC
Testing notes (using KTD) - MARC21 installation:

1. Examples of valid and invalid ISSNs:
   - Valid: 0317-8471, 1050-124X, 1234-5679
   - Invalid: 1234-5679X (too long), 1234-567 (too short), 1234-567A (only X is allowed)

2. Edit the SER framework to add validate_issn.pl to 22$a.

3. Edit a record with an ISSN tag (I used Chapman, biblionumber = 44)
Comment 10 David Nind 2026-01-06 17:25:19 UTC
Just adding this link about ISSNs and their format: https://www.issn.org/understanding-the-issn/what-is-an-issn/
Comment 11 Marcel de Rooy 2026-01-16 07:49:16 UTC
Looking here now
Comment 12 Marcel de Rooy 2026-01-16 10:40:00 UTC
Created attachment 191557 [details] [review]
Bug 41060: Add a cataloguing plugin to check ISSN

Test plan:
- without patch login to Koha
- edit a biblio and put a wrong ISSN in 022a (011a for unimarc).
- leave the input field (looses focus), no warning
- apply patch and do "reset_all" to make a full re-install.
- edit the biblio again and put an invalid ISSN in 022a (011a for unimarc).
- when you leave the input field you should have a warning saying
  "invalid ISSN".
- the input field should turn yellow
- you can still save the biblio with a wrong issn, it is just a warning.
- if you apply the patch on an existing install, you must manually link
  the value builder to your existing frameworks to get it working.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2026-01-16 10:40:03 UTC
Created attachment 191558 [details] [review]
Bug 41060: (QA follow-up) improve ISSN format detection

Two tests have been added:
- not only the checksum of the ISSN is checked but also the format.
- if the ISSN is left empty, the plugin won't give a warning.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Marcel de Rooy 2026-01-16 10:40:05 UTC
Created attachment 191559 [details] [review]
Bug 41060: (QA follow-up) Check in change, trigger once in Blur

If we already checked and nothing changes, no need to check again.
Set focus to field if we warn.
For consistency copied these changes to validate_isbn.

Test plan:
Try various valid and invalid ISSNs.
Tab through the field repeatedly; you should only have a warning
once, if the ISSN is invalid (yellow colored).
Save a bad ISSN into a record. Open it again and tab through ISSN;
you should be warned.

Repeat similarly for ISBN field.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 15 Marcel de Rooy 2026-01-16 10:40:07 UTC
Created attachment 191560 [details] [review]
Bug 41060: (QA follow-up) Consistent return for empty string

An empty ISBN should not warn just like an empty ISSN.

Test plan:
Verify that clearing ISBN or ISSN does not warn anymore.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Marcel de Rooy 2026-01-16 10:43:54 UTC
Added follow-up for some minor things. Still seeing that adding additional text outside [0-9X] is fine for ISBN, but is not for ISSN.

This inconsistency comes from the regex that we use in ISSN (and not in ISBN).
No big thing.
Note that catalogers may be used to more text after an ISBN? But when using an additional X the ISBN will be invalid.. Which is a bit weird again.
Comment 17 Lucas Gass (lukeg) 2026-01-22 17:04:55 UTC
Nice work everyone!

Pushed to main for 26.05