https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32332
--- Comment #2 from Magnus Enger <[email protected]> --- Done some more digging, and I think I found the problem. The POD for bulkmarcimport.pl reads: -insert if set, only insert when possible -update if set, only updates (any biblio should have a matching record) -all if set, do whatever is required The way I interpret this, if -insert is provided, records that are not present in the database (based on the matching provided by -match) should be inserted, and records that are already present should be skipped and not updated. If the script is run with -match and -insert, it will look for an existing record. If one is found, then the following logic happens: if ($biblionumber) { eval{ $biblioitemnumber = Koha::Biblios->find( $biblionumber )->biblioitem->biblioitemnumber; }; if ($update) { # If run with -update, but this is not what we are looking for } else { # If run with -insert, nothing happens, except some logging printlog( { id => $id || $originalid || $biblionumber, op => "insert", status => "warning : already in database" } ) if ($logfile); } } else { # An existing record was not found } This looks OK, nothing happens if there is a match and -insert is provided. But then, further down in the script, ModBiblioMarc gets run for all records: ModBiblioMarc( $clone_record, $biblionumber ); This updates biblio_metadata.metadata, even if we did not want to update records that have a match! To check this behviour, run the "bulkmarcimport.pl -import" command I gave in the first comment, then log into the database and run this: MariaDB [koha_kohadev]> select timestamp from biblio_metadata where biblionumber = 439; (Replace 439 with the biblionumber you got, if you got another biblionumber.) Then run "bulkmarcimport.pl -import" again and check the timestamp again. It will be different from the first timestamp. This could have worked (sort of), if the 999 field was added in ModBiblioMarc, but since bug 29486 that has not been the case. I think the solution here is to not run ModBiblioMarc for records that have a match, when run with -insert? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
