Bug 30920: (follow-up) Cleanup warning from C4::Biblio::GetAuthorisedValueDesc
[koha-ffzg.git] / C4 / Biblio.pm
index 991d327..e90eb11 100644 (file)
@@ -1375,6 +1375,8 @@ descriptions rather than normal ones when they exist.
 sub GetAuthorisedValueDesc {
     my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_;
 
+    return q{} unless defined($value);
+
     my $cache     = Koha::Caches->get_instance();
     my $cache_key;
     if ( !$category ) {
@@ -1413,7 +1415,7 @@ sub GetAuthorisedValueDesc {
         }
 
         if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) {
-            $cache_key = "ClassSources";
+            $cache_key = "cn_sources:description";
             my $cn_sources = $cache->get_from_cache( $cache_key, { unsafe => 1 } );
             if ( !$cn_sources ) {
                 $cn_sources = {