[Bug 9500] New: GetNormalizedISBN only ever checks the first populated ISBN field
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Bug ID: 9500 Summary: GetNormalizedISBN only ever checks the first populated ISBN field Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: kyle@bywatersolutions.com If you take a look at C4::Koha::GetNormalizedISBN you will see code like this: if ($marcflavour eq 'UNIMARC') { @fields = $record->field('010'); foreach my $field (@fields) { my $isbn = $field->subfield('a'); if ($isbn) { return _isbn_cleanup($isbn); } else { return undef; } } } If I read this correctly, if we have say two ISBNs in a record, with the first being invalid and the second being valid, GetNormalizedISBN will still return undef because it never bothers to check the second isbn! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Denise <d.gavio@aarome.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |d.gavio@aarome.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |barton@bywatersolutions.com --- Comment #1 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 32608 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32608&action=edit MARCXML file with multiple ISBN numbers -- ISBN-13 first Stage and import this record. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 --- Comment #2 from Barton Chittenden <barton@bywatersolutions.com> --- Oh, the badness goes *so* much deeper: GetNormalizedISBN calls _isbn_cleanup(): sub _isbn_cleanup { my ($isbn) = @_; return NormalizeISBN( { isbn => $isbn, format => 'ISBN-10', strip_hyphens => 1, } ) if $isbn; } ... So if the first ISBN isn't a valid *10 digit* isbn, GetNormalizedISBN will fail. I've attached a MARCXML record which will trigger the bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9500 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Could you describe an issue visible on the interface? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org