From 29f622a42a6afb4f3f92ebc72d1c8ddd3c8b98af Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Tue, 6 Jan 2026 10:03:52 +0000 Subject: [PATCH] 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 --- cataloguing/value_builder/validate_issn.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cataloguing/value_builder/validate_issn.pl b/cataloguing/value_builder/validate_issn.pl index 7bda38082b..164af3ef16 100755 --- a/cataloguing/value_builder/validate_issn.pl +++ b/cataloguing/value_builder/validate_issn.pl @@ -60,7 +60,13 @@ my $launcher = sub { flagsrequired => { editcatalogue => '*' }, } ); - my $is_valid = is_valid_checksum($issn); + my $is_valid = 0; + if ( $issn =~ /^\d{4}-\d{3}[\dXx]$/ ) { + $is_valid = is_valid_checksum($issn); + } + if ( $issn eq '' ) { + $is_valid = 1; + } $template->param( return => $is_valid ); output_html_with_http_headers $cgi, $cookie, $template->output; }; -- 2.39.5