[Bug 14420] New: bulkmarcimport.pl - Some problems
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Bug ID: 14420 Summary: bulkmarcimport.pl - Some problems Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: vfernandes@keep.pt QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz PROBLEM 1 If a record as some than one ISBN, the values are recorded in database like 'isbn1 | isbn2 | isbn3'. In the script the ISBN match are only checking for exact ISBN matching. my $sth_isbn = $dbh->prepare("SELECT biblionumber,biblioitemnumber FROM biblioitems WHERE isbn=? OR isbn like ? OR isbn like ? OR isbn like ?"); The script should verify if the ISBN is a exact match or if it appears in start, in the middle or in the end of the database isbn column: my $sth_isbn = $dbh->prepare("SELECT biblionumber,biblioitemnumber FROM biblioitems WHERE isbn=? OR isbn like ? OR isbn like ? OR isbn like ?"); The query execution should also be changed: $sth_isbn->execute($isbn, $isbn." | %", "% | ".$isbn, "% | ".$isbn." | %"); PROBLEM 2 The ISBN is not being saved in the variable $isbn because of the following line: my $isbn = $field && $field->subfield('a'); The "my" before the variable should be removed. PROBLEM 3 The $biblionumber and $biblioitemnumber are being lost after the record modification in the case of being a duplicate record. ModBiblio returns 1 if everything works right in the record modification. The following line code should be modified: eval { ( $biblionumber, $biblioitemnumber ) = ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) }; The result should be: eval { ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) }; PROBLEM 4 When modifying a record, maybe we want to append the items to the existing record. So we should pass a clone of the record to the method ModBiblio, because that method strips all items in the record. This should be done with a new argument. -updateadditems The line: eval { ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) }; Is changed to: my $clone = $updateadditems ? $record->clone() : $record; eval { ModBiblio( $clone, $biblionumber, GetFrameworkCode($biblionumber) ) }; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Vitor Fernandes <vfernandes@keep.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Vitor Fernandes <vfernandes@keep.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |vfernandes@keep.pt --- Comment #1 from Vitor Fernandes <vfernandes@keep.pt> --- Created attachment 40362 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40362&action=edit bulkmarcimport.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Vitor Fernandes <vfernandes@keep.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Vitor, can you please add a test plan? Some sample records might also be helpful to make this easier to test. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ah, also make sure test plan and problem description are part of your commit message! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 --- Comment #4 from Vitor Fernandes <vfernandes@keep.pt> --- Created attachment 41338 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41338&action=edit Bug 14420 : bulkmarcimport.pl - Some problems http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Created by: Vitor Fernandes <vfernandes@keep.pt> Sponsored by: KEEP SOLUTIONS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Vitor Fernandes <vfernandes@keep.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41338|0 |1 is obsolete| | --- Comment #5 from Vitor Fernandes <vfernandes@keep.pt> --- Created attachment 41339 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41339&action=edit Bug 14420 : bulkmarcimport.pl - Some problems http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Test plan: - Add one record with two ISBN using bulkmarcimport - Add the same record using bulkmarcimport with ISBN comparing - The comparing of ISBN isn't working because the bulkmarcimport are trying to check if isbn1 is in the column isbn of biblio table (check if equal). The column isbn of the first record is "isbn1 | isbn2". - Add one record with one ISBN using bulkmarcimport - Add the same record using bulkmarcimport and ISBN comparing - The first record will be updated but the items of the second record will not be added to the first one - Apply the patch - Add one record with two ISBN using bulkmarcimport - Add the same record using bulkmarcimport with ISBN comparing - The comparing of ISBN will work because the bulkmarcimport will use "like" comparing instead of "equal" - Add one record with one ISBN using bulkmarcimport - Add the same record using bulkmarcimport with ISBN comparing and updateadditems - The first record will be updated and the items of the second record will be added to the first one Created by: Vitor Fernandes <vfernandes@keep.pt> Sponsored by: KEEP SOLUTIONS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14420 Heather Braum <hbraum@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hbraum@nekls.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org