updated release notes for 3.14.0 beta
[koha.git] / authorities / authorities-list.pl
old mode 100644 (file)
new mode 100755 (executable)
index 9c472f1..2b15856
@@ -4,7 +4,7 @@ use warnings;
 use C4::Context;
 use C4::AuthoritiesMarc;
 use utf8;
-use open qw( :std :utf8 );
+use open qw[ :std :encoding(utf8) ];
 
 my $dbh=C4::Context->dbh;
 my $datatypes_query = $dbh->prepare(<<ENDSQL);
@@ -25,6 +25,9 @@ foreach my $authority (@$dataauthorities){
   $query= "an=".$authority->{'authid'};
   # search for biblios mapped
   my ($err,$res,$used) = C4::Search::SimpleSearch($query,0,10);
+  if (defined $err) {
+      $used = 0;
+  }
   if ($marcauthority && $marcauthority->field($authtypes{$authority->{'authtypecode'}}->{'tag'})){
     print qq("),$marcauthority->field($authtypes{$authority->{'authtypecode'}}->{"tag"})->as_string(),qq(";),qq($authority->{'authid'};"),$authtypes{$authority->{'authtypecode'}}->{'lib'},qq(";$used\n);
   }