@@ -, +, @@ --- Koha/Libraries.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) --- a/Koha/Libraries.pm +++ a/Koha/Libraries.pm @@ -66,20 +66,17 @@ sub search_filtered { =head3 single_library_mode - Aka singleBranchMode. - my $boolean = Koha::Libraries->single_library_mode; - Returns 1 if there is only one library marked public. +Returns 1 if there is only one library marked public. =cut -sub single_library_mode { # formerly called singleBranchMode +sub single_library_mode { my $self = shift; - if( $self->search({ public => 1 })->count == 1 ) { # Historically we test number==1 instead of number<2 - return 1; - } - return 0; + + # Historically we test number==1 instead of number<2 + return $self->search({ public => 1 })->count == 1 ? 1 : 0; } =head3 type --