From 64d0672ebb94711a9810dd5511a002f9cc4b6d35 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Sat, 25 Jun 2022 11:18:42 +0000 Subject: [PATCH] Bug 30327: Supply defaults if component sort fields not set This patch fetches the new sysprefs into variables, providing default title ascending if they are not set to avoid an undefined concatenation warning --- Koha/Biblio.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 52cc36f2d6..ea0c9d9f84 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -565,7 +565,9 @@ sub get_components_query { my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); my $marc = $self->metadata->record; - my $sort = C4::Context->preference('ComponentSortField') . "_" . C4::Context->preference('ComponentSortOrder'); + my $component_sort_field = C4::Context->preference('ComponentSortField') // "title"; + my $component_sort_order = C4::Context->preference('ComponentSortOrder') // "asc"; + my $sort = $component_sort_field . "_" . $component_sort_order; my $searchstr; if ( C4::Context->preference('UseControlNumber') ) { -- 2.30.2