@@ -, +, @@ institution ids causes workers to die without responding --- C4/SIP/SIPServer.pm | 3 +++ C4/SIP/Sip/Configuration.pm | 8 ++++++++ 2 files changed, 11 insertions(+) --- a/C4/SIP/SIPServer.pm +++ a/C4/SIP/SIPServer.pm @@ -30,6 +30,9 @@ use base qw(Net::Server::PreFork); use constant LOG_SIP => "local6"; # Local alias for the logging facility + +set_logger( Koha::Logger->get( { interface => 'sip' } ) ); + # # Main # not really, since package SIPServer # --- a/C4/SIP/Sip/Configuration.pm +++ a/C4/SIP/Sip/Configuration.pm @@ -9,8 +9,10 @@ package C4::SIP::Sip::Configuration; use strict; use warnings; use XML::Simple qw(:strict); +use List::Util qw(uniq); use C4::SIP::Sip qw(siplog); +use Koha::Libraries; my $parser = XML::Simple->new( KeyAttr => { @@ -47,6 +49,12 @@ sub new { } $cfg->{listeners} = \%listeners; + my @branchcodes = Koha::Libraries->search()->get_column('branchcode'); + my @institutions = uniq( keys %{ $cfg->{institutions} } ); + foreach my $i ( @institutions ) { + siplog("LOG_ERR", "ERROR: Institution $i does does not match a branchcode. This can cause unexpected behavior.") unless grep( /^$i$/, @branchcodes ); + } + return bless $cfg, $class; } --