[Koha-bugs] [Bug 35591] bulkmarcimport.pl overwrites data if controlnumber eq authid

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 23 17:37:36 CET 2024


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

--- Comment #6 from Thomas Klausner <domm at plix.at> ---
Created attachment 161306
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161306&action=edit
Bug 35591: Prevent bulkmarcimport from replacing local auth_header

If you run bulkmarcimport,pl on authorities with --update (or --all)
it will overwrite a local auth_header if the auth_id of a local
auth_header matches the control-number (field 001) of an imported MARC
record.

This patch adds a new option --guessauthid (which is still enabled by
default to keep the script backwards compatible, but broken), which can
turn off this behaviour if called as --noguessauthid.

To test with koha-testing-docker:

* Inspect cgi-bin/koha/authorities/detail.pl?authid=1402 which should be
  PERSO_NAME of Aristotles.
* get the file twin_040682714.xml from Bugzilla and make it available
  inside of koha-testing-docker
* run:
  misc/migration_tools/bulkmarcimport.pl -m MARCXML -c utf8 -a --file
twin_040682714.xml --all --match isbn,001
* Check cgi-bin/koha/authorities/detail.pl?authid=1402, which now is a
  TOPIC_TERM "Zwilling" (twin...)

Reset koha-testing-docker, apply the patch

* run with the new flag
  misc/migration_tools/bulkmarcimport.pl -m MARCXML -c utf8 -a --file
twin_040682714.xml --all --match isbn,001 --noguessauthid

* cgi-bin/koha/authorities/detail.pl?authid=1402 still is "Aristotle"

* "Zwilling" is cgi-bin/koha/authorities/detail.pl?authid=1708 (at least
  on my ktd, the actual id might vary)

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


More information about the Koha-bugs mailing list