Test plan:
1) Shut down zebra: koha-zebra-ctl.sh stop
2) Execute the script: remove_unused_authorities.pl (with -t if you don't want to really delete from your database).
3) Check that the script would have deleted all the authorities (eg: 31449 authorities parsed, 31449 deleted and 0 unchanged because used).
4) Apply patch
5) Run, notice that the script dies because zebra is unavailable
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
print "testing only, authorities will not be deleted.\n";
}
+if (C4::Context->Zconn("biblioserver",0)->errcode() == 10000) {
+ die "Zebra server seems not to be available. This script needs Zebra runs."
+}
+
my $dbh=C4::Context->dbh;
my $thresholdmin=0;
my $thresholdmax=0;