[Koha-bugs] [Bug 32332] bulkmarcimport.pl -insert fails to add MARC field 999

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 5 09:26:49 CET 2022


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

--- Comment #4 from Magnus Enger <magnus at libriotech.no> ---
Thanks for looking at this! 

I find it kind of hard to get my head around the logic of this script too. 

> Maybe we need a "next" in the "search for a match" block?

I *think* it makes sense to skip to the next record if we have -insert, and we
have found a matching record. But if we skip as early as line ~351, we miss the
logging that happens on line 457:

printlog( { id => $id || $originalid || $biblionumber, op => "insert", status
=> "warning : already in database" } ) if ($logfile);

So that should probably be moved to before the "next". 

> Or, another option, more inline with your diagnostic, could be to...
> 
> -            ModBiblioMarc( $clone_record, $biblionumber );
> +            ModBiblioMarc( $clone_record, $biblionumber ) if $insert;

Just before this we do this: 

my $clone_record = $record->clone();

This seems to be unnecessary if are not updating anything anyway.

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


More information about the Koha-bugs mailing list