From 5de9f68ce241e04eb506503f71bb97b56ead8697 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 14 Oct 2025 10:10:08 +0200 Subject: [PATCH] Bug 41008: Fix bulkmarimport.pl -a -d After bug 35659 that added the OAI harvester to Koha the -d switch for deleting authorities before importing with bulkmarcimport.pl was broken and resulted in a FK error. Switching from truncate to DELETE FROM like we already did for items, biblio etc. fixes the issue. To test: - Make sure you have some authorities in your database - Export some into a file for importing - Run bulkmarcimport -a -d --file - Verify you get the a DB FK constraint error. - Apply patch - Repeat steps, verify the script now works as expected again * Existing authorities are deleted * File is imported --- misc/migration_tools/bulkmarcimport.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index cd5fa255a6e..147aa57118c 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -236,7 +236,7 @@ if ($delete) { $dbh->do("ALTER TABLE items AUTO_INCREMENT = 1"); } else { print "Deleting authorities\n"; - $dbh->do("truncate auth_header"); + $dbh->do("DELETE FROM auth_header"); } $dbh->do("truncate zebraqueue"); } -- 2.39.5