[Koha-bugs] [Bug 14420] New: bulkmarcimport.pl - Some problems

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 19 12:22:52 CEST 2015


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 at gmail.com
          Reporter: vfernandes at keep.pt
        QA Contact: testopia at bugs.koha-community.org
                CC: robin at 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.


More information about the Koha-bugs mailing list