Bugzilla – Attachment 192106 Details for
Bug 41713
warnings sometimes generated when using ShowComponentRecords feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41713: warnings sometimes generated when using ShowComponentRecords feature
Bug-41713-warnings-sometimes-generated-when-using-.patch (text/plain), 4.28 KB, created by
Roman Dolny
on 2026-01-27 20:36:22 UTC
(
hide
)
Description:
Bug 41713: warnings sometimes generated when using ShowComponentRecords feature
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2026-01-27 20:36:22 UTC
Size:
4.28 KB
patch
obsolete
>From e4d91067a667d292ad6db39a1a33d19e31140397 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Mon, 26 Jan 2026 15:04:14 +0000 >Subject: [PATCH] Bug 41713: warnings sometimes generated when using > ShowComponentRecords feature > >When using ShowComponentRecords feature warnings are generated from >staff interface detail view when: >1. ShowComponentRecords = 'both' or 'staff' AND >2. UseControlNumber is on AND >3. record lacks 001 field > >Test plan >========= >1. Have a standard ktd instance with Elasticsearch. >2. Set UseControlNumber systempreference to Use. > Set ShowComponentRecords systempreference to both staff and OPAC. >3. In OPAC and in staff interface, open in Normal > view a record without field 001, e.g. # 399 > ("Art Since 1980"). >4. Check plack-opac-error.log and plack-intranet-error.log. > You should see fresh warnings like: > [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. > [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/opac/opac-detail.pl line 640 > > [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. > [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/catalogue/detail.pl line 273. >5. Apply the patch; restart_all. >6. Repeat p. 4. There should be no new warnings. > >Sponsored-by: Ignatianum University in Cracow >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > Koha/Biblio.pm | 3 ++- > catalogue/detail.pl | 8 ++++---- > opac/opac-detail.pl | 5 +++-- > 3 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 67ea254c63..9662178cb0 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -952,7 +952,8 @@ sub get_components_query { > $cleaned_title = $builder->clean_search_term($cleaned_title); > $searchstr = qq#Host-item:("$cleaned_title")#; > } >- my ( $error, $query, $query_str ) = $builder->build_query_compat( undef, [$searchstr], undef, undef, [$sort], 0 ); >+ my ( $error, $query, $query_str ) = >+ $builder->build_query_compat( undef, [ $searchstr // '' ], undef, undef, [$sort], 0 ); > if ($error) { > warn $error; > return; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 05a2d14140..fd6ee53d1c 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -247,10 +247,10 @@ foreach my $subscription (@subscriptions) { > my $showcomp = C4::Context->preference('ShowComponentRecords'); > my $show_analytics; > if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { >- if ( my $components = >- !$invalid_marc_record ? $biblio->get_marc_components( C4::Context->preference('MaxComponentRecords') ) : undef ) >- { >- $show_analytics = 1 if @{$components}; # just show link when having results >+ my $components = >+ !$invalid_marc_record ? $biblio->get_marc_components( C4::Context->preference('MaxComponentRecords') ) : undef; >+ if ( @{$components} ) { >+ $show_analytics = 1; # just show link when having results > $template->param( analytics_error => 1 ) > if grep { $_->message eq 'component_search' } @{ $biblio->object_messages }; > my $parts; >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index edf609cb02..48dc175701 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -619,8 +619,9 @@ my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 5 > my $showcomp = C4::Context->preference('ShowComponentRecords'); > my ( $parts, $show_analytics ); > if ( $showcomp eq 'both' || $showcomp eq 'opac' ) { >- if ( my $components = $biblio->get_marc_components( C4::Context->preference('MaxComponentRecords') ) ) { >- $show_analytics = 1 if @{$components}; # just show link when having results >+ my $components = $biblio->get_marc_components( C4::Context->preference('MaxComponentRecords') ); >+ if ( @{$components} ) { >+ $show_analytics = 1; # just show link when having results > for my $part ( @{$components} ) { > $part = C4::Search::new_record_from_zebra( 'biblioserver', $part ); > my $id = Koha::SearchEngine::Search::extract_biblionumber($part); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41713
:
192054
|
192055
|
192056
|
192057
| 192106 |
192107