From e86fe412e6e636171c2ca590cdf1815117992bee Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 1 Sep 2020 13:32:46 +0000 Subject: [PATCH] Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities This script checks that an authority is not being used before deleting it. We do not need to check biblios for the authority id as we have already verified it is unused. TO test: 1 - Reset db to koha test database 2 - perl misc/migration_tools/remove_unused_authorities.pl -t 3 - Note a number of unsued authorities 4 - perl misc/migration_tools/remove_unused_authorities.pl -c 5 - Note authorities are removed 6 - Reset db 7 - Apply patch 8 - perl misc/migration_tools/remove_unused_authorities.pl -t 9 - Note results are the same 10 - perl misc/migration_tools/remove_unused_authorities.pl -c 11 - Note results are the same --- misc/migration_tools/remove_unused_authorities.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl index ece2b0f992..63670b6a0b 100755 --- a/misc/migration_tools/remove_unused_authorities.pl +++ b/misc/migration_tools/remove_unused_authorities.pl @@ -95,7 +95,7 @@ while (my $data=$rqselect->fetchrow_hashref){ } unless ($used > 0){ unless ($test) { - DelAuthority({ authid => $data->{'authid'} }); + DelAuthority({ authid => $data->{'authid'}, skip_merge => 1 }); print " : deleted"; } else { print " : can be deleted"; -- 2.11.0