Ticket #2954 (new enhancement)

Opened 6 years ago

Last modified 3 years ago

Validate ISBN (10 and 13 digit) and ISSN

Reported by: tmb Owned by: cjg
Priority: unset Milestone: EPrints 3.2.10
Component: Workflow & InputForm Version:
Severity: normal Keywords:
Cc:

Description

The Algorithm::CheckDigits? module makes this simple and helps us claim better quality metadata.

Need to decide whether we want to add this.

I added this ISBN check to field_validate.pl for NORA (Algorithm::CheckDigits? can also check ISSNs):

if( $field->get_name eq "isbn" && EPrints::Utils::is_set( $value ) ) {

use Algorithm::CheckDigits?;

my $isbn = CheckDigits?( "ISBN" ); my $isbn13 = CheckDigits?( "ISBN13" );

if( !$isbn->is_valid( $value ) && !$isbn13->is_valid( $value ) ) {

my $fieldname = $session->make_element( "span", class=>"ep_problem_field:".$field->get_name ); $fieldname->appendChild( $field->render_name( $session ) ); push @problems,

$session->html_phrase( "validate:bad_isbn",

fieldname=>$fieldname );

}

}

Should make this only apply if Algorithm::CheckDigits? is installed so as not to add to lists of required modules.

Change History

Changed 6 years ago by cjg

  • milestone changed from EPrints 3.0.1 to EPrints 3.1 beta

Changed 3 years ago by cjg

  • owner set to cjg
  • component changed from - to Workflow & InputForm
  • milestone changed from EPrints Wishlist to EPrints 3.2.2
Note: See TracTickets for help on using tickets.