[Koha-bugs] [Bug 17608] Fix behaviour of bulkmarcimport.pl -insert

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 22 12:09:58 CET 2018


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

--- Comment #8 from Magnus Enger <magnus at libriotech.no> ---
Some further observations:

I have a bunch of MARC-records in a file that I import with:

bulkmarcimport.pl -insert -match=Control-number,001 -l /tmp/insert.log

(I use some more options as well, of course, but these are the interesting
ones), because I want to check if the records exist (based on the value in 001)
and only add them if they do not already exist in Koha. When I look at the log,
I see something like this:

126210;insert;ok
126210;insert;ok
103703;insert;warning : already in database
103703;insert;ok
126211;insert;ok
126211;insert;ok

126210 and 126211 are OK, they did not exist and have now been added. 

Since the script has correctly figured out that 103703 is already in the
database, I would expect it to be skipped. But when I look at the timestamps in
the database it turns out the entries in the biblio and biblioitems tables were
not affected, but biblio_metadata *was* actually updated. And the item was
added to the record. This means I now have two items on this record, where
there should just be one. 

This behaviour seems to be caused by having the logic for update/insert on
lines 453-477 of bulkmarcimport, followed by calls to AddItemBatchFromMarc on
line 479 (this adds the items, even if -insert was specified and the record was
found to exist in koha) and ModBiblioMarc on line 487 (this updates
biblio_metadata).

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


More information about the Koha-bugs mailing list