[Koha-bugs] [Bug 34860] New framework plugin for ISBN/ISSN

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 21 10:28:04 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34860

--- Comment #3 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Code with optional suffix stripping:

function isbn_check ( subfield, strip_suffix ) {
    // Remove hyphens from isbn part, handle suffix by split on space
    var split_field = subfield.split( ' ', 2 );
    var isbn = split_field[0].replace( /[-]/g, '' );
    var suffix;
    if( strip_suffix ) suffix = '';
    else suffix = split_field[1] ? ' ' + split_field[1] : '';

    if ( isbn.match(/^\d{9}(\d{3})?[0-9X]$/) ) {
        if( valid_isbn_check_digit(isbn) ) return [ 1, isbn + suffix ];
    }
    return [ 0, isbn + suffix ];
}

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list