From 6560049c65d911905090afa3bf261984fa4b35f1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 23 Jul 2021 15:16:32 +0200 Subject: [PATCH] Bug 27526: Fix cn_source display For an unknown reason C4::Biblio::GetAuthorisedValueDesc (that we are calling from Koha::Item->columns_to_str) does not deal with class sources. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- C4/Biblio.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index cf79d1e4b3..d2df1b5111 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -91,7 +91,7 @@ use Module::Load::Conditional qw( can_load ); use C4::Koha; use C4::Log qw( logaction ); # logaction use C4::Budgets; -use C4::ClassSource qw( GetClassSort ); +use C4::ClassSource qw( GetClassSort GetClassSource ); use C4::Charset qw( nsb_clean SetMarcUnicodeFlag @@ -1426,6 +1426,11 @@ sub GetAuthorisedValueDesc { return $itemtype ? $itemtype->translated_description : q||; } + if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) { + my $source = GetClassSource($value); + return $source ? $source->{description} : q||; + } + #---- "true" authorized value $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'}; } -- 2.39.5