From 1682341b5849c34e59597cda780d4c877d6f3278 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 27 Apr 2020 10:31:19 +0200 Subject: [PATCH] Bug 21395: Fix QA errors Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- docs/CAS/CASProxy/examples/proxy_cas_data.pl | 2 +- .../migration_tools/22_to_30/export_Authorities.pl | 4 +++- .../22_to_30/export_Authorities_xml.pl | 4 +++- .../22_to_30/move_marc_to_biblioitems.pl | 5 ++--- reports/reserves_stats.pl | 4 ++-- rewrite-config.PL | 11 +++++++---- t/db_dependent/Record/Record.t | 2 +- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/CAS/CASProxy/examples/proxy_cas_data.pl b/docs/CAS/CASProxy/examples/proxy_cas_data.pl index 70ea24c..4c72a63 100755 --- a/docs/CAS/CASProxy/examples/proxy_cas_data.pl +++ b/docs/CAS/CASProxy/examples/proxy_cas_data.pl @@ -23,7 +23,7 @@ =head1 CGI PARAMETERS -=item PGTIOU +=head2 PGTIOU The Proxy Granting Ticket IOU the CAS Server returned to us when we gave him the Service Ticket This PGTIOU will allow us to retrive the matching PGTID diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl index 956805a..479981c 100755 --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ b/misc/migration_tools/22_to_30/export_Authorities.pl @@ -31,7 +31,9 @@ while (my ($authid,$authtypecode)=$rq->fetchrow){ if (C4::Context->preference('marcflavour') eq "UNIMARC"){ $record->leader(' nac 22 1u 4500'); - my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef + my @time = localtime(time); + my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]); + my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef; $string=~s/\-//g; $string = sprintf("%-*s",26, $string); substr($string,9,6,"frey50"); diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index c8a5aa9..6c91708 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -30,7 +30,9 @@ open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unab # if (C4::Context->preference('marcflavour') eq "UNIMARC"){ $record->leader(' nac 22 1u 4500'); - my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef + my @time = localtime(time); + my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]); + my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef; $string=~s/\-//g; $string = sprintf("%-*s",26, $string); substr($string,9,6,"frey50"); diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl index 38ea289..386831e 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl @@ -26,7 +26,7 @@ $dbh->do('ALTER TABLE `biblioitems` CHANGE `marc` `marc` LONGBLOB NULL DEFAULT N # adding marc xml, just for convenience $dbh->do('ALTER TABLE `biblioitems` ADD `marcxml` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL '); # moving data from marc_subfield_value to biblio -$sth = $dbh->prepare('select bibid,biblionumber from marc_biblio'); +my $sth = $dbh->prepare('select bibid,biblionumber from marc_biblio'); $sth->execute; my $sth_update = $dbh->prepare('update biblioitems set marc=?, marcxml=? where biblionumber=?'); my $totaldone=0; @@ -46,7 +46,7 @@ while (my ($bibid,$biblionumber) = $sth->fetchrow) { $sth_update->execute($record->as_usmarc(),$record->as_xml_record($marcflavour),$biblionumber); $totaldone++; print "."; - print "\r$totaldone / $totaltodo" unless ($totaldone % 100); + print "\r$totaldone" unless ($totaldone % 100); } print "\rdone\n"; @@ -149,7 +149,6 @@ sub LocalMARCgetbiblio { } if (C4::Context->preference('marcflavour')=~/unimarc/i){ $record->leader(' nac 22 1u 4500'); - $update=1; my $string; if ($record->field(100)) { $string = substr($record->subfield(100,"a")." ",0,35); diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl index c034d46..1d22561 100755 --- a/reports/reserves_stats.pl +++ b/reports/reserves_stats.pl @@ -38,11 +38,11 @@ use YAML; =head1 NAME - reports/reserve_stats.pl +reports/reserve_stats.pl =head1 DESCRIPTION - Plugin that shows reserve stats +Plugin that shows reserve stats =cut diff --git a/rewrite-config.PL b/rewrite-config.PL index 3047f8d..f907a03 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -60,6 +60,8 @@ also need to override WEBSERVER_IP. =cut +my $myhost; +my $mydomain; if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) { ( $mydomain = $myhost ) =~ s/.*?\.//; } else { @@ -67,6 +69,7 @@ if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) { $mydomain = 'localdomain'; } +my $myip; unless ( $myip = $ENV{WEBSERVER_IP} ) { my $byname = gethostbyname( $myhost ) or die "Could not get the IP address of $myhost, DNS fault? ($!)"; @@ -75,12 +78,12 @@ unless ( $myip = $ENV{WEBSERVER_IP} ) { } -$prefix = $ENV{'INSTALL_BASE'} || "/usr"; +my $prefix = $ENV{'INSTALL_BASE'} || "/usr"; # These are our configuration guesses # Keys were extracted by # "",/' -%configuration = ( +my %configuration = ( "__KOHA_INSTALLED_VERSION__" => "no_version_found", "__LOG_DIR__" => "/var/log", "__PLUGINS_DIR__" => "/var/lib/koha/plugins", @@ -172,8 +175,8 @@ if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') { $configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = ''; } -$fname = $ARGV[0]; -$file = &read_file($fname); +my $fname = $ARGV[0]; +my $file = &read_file($fname); $file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg; # At this point, file is in 'blib' and by default diff --git a/t/db_dependent/Record/Record.t b/t/db_dependent/Record/Record.t index 6fb335f..384588d 100755 --- a/t/db_dependent/Record/Record.t +++ b/t/db_dependent/Record/Record.t @@ -61,7 +61,7 @@ foreach my $line (<$MARC21UTF8>) { $marc21_utf8 =~ s/\n$//; close $MARC21UTF8; -open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat" or die $!; +open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat") or die $!; my $marc21_marc8_combining_chars; foreach my $line(<$MARC21MARC8COMBCHARS>) { $marc21_marc8_combining_chars.=$line; -- 1.7.2.5