From 1ff478cc968011e6952a976a0a8b9b412f2f6ced Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 17 Mar 2022 16:19:16 +0100 Subject: [PATCH] Bug 30008: (bug 29690 follow-up) Fix Invalid data, cannot decode metadata object Test plan: 1 - Find a record in the staff catalog 2 - Edit the record 3 - In the 520 notes field, add an ASCII escape character (27 decimal, 1b hex) On ubuntu Ctrl+Shift+u, then 1b, enter 4 - Save the record 5 - Set syspref ShowComponentRecords to 'both...' 6 - On record details: New->New child record 7 - Save the record 8 - Attempt to view the parent record in the staff client and opac Signed-off-by: Fridolin Somers Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- catalogue/detail.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 75aeed0e96..2d66b836f7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -197,7 +197,7 @@ foreach my $subscription (@subscriptions) { my $showcomp = C4::Context->preference('ShowComponentRecords'); my $show_analytics; if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { - if ( my $components = $biblio->get_marc_components(C4::Context->preference('MaxComponentRecords')) ) { + if ( my $components = $marc_record ? $biblio->get_marc_components(C4::Context->preference('MaxComponentRecords')) : undef ) { $show_analytics = 1 if @{$components}; # just show link when having results $template->param( analytics_error => 1 ) if grep { $_->message eq 'component_search' } @{$biblio->object_messages}; my $parts; -- 2.39.5