From 41fb8527b18d1ebaa25934cfd9a01f8b8c4e43be Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 25 Jun 2020 11:31:49 +0100 Subject: [PATCH] Bug 21395: (QA follow-up) Remove some introduced issues This patch removes some new error cases introduced during rebase Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit e968af43777d47c9134ea1875270af9661ef2f5a) Signed-off-by: Lucas Gass --- C4/InstallAuth.pm | 21 ++++-------- docs/CAS/CASProxy/examples/koha_webservice.pl | 4 +++ misc/migration_tools/bulkmarcimport.pl | 4 +-- misc/translator/TmplTokenizer.pm | 32 +++++++++---------- misc/translator/xgettext.pl | 10 +++--- reports/bor_issues_top.pl | 2 +- t/db_dependent/LDAP/test_ldap_add.pl | 2 +- tools/batchMod.pl | 4 +-- 8 files changed, 38 insertions(+), 41 deletions(-) diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm index e5d9514f1b..bc2bb0ed3f 100644 --- a/C4/InstallAuth.pm +++ b/C4/InstallAuth.pm @@ -31,6 +31,11 @@ use C4::Koha; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +@ISA = qw(Exporter); +@EXPORT = qw( + &checkauth + &get_template_and_user +); =head1 NAME @@ -68,17 +73,7 @@ InstallAuth - Authenticates Koha users for Install process =head1 FUNCTIONS -=over 2 - -=cut - -@ISA = qw(Exporter); -@EXPORT = qw( - &checkauth - &get_template_and_user -); - -=item get_template_and_user +=head2 get_template_and_user my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "opac-main.tt", @@ -168,7 +163,7 @@ sub _get_template_language { -d $path ? $opaclang : 'en'; } -=item checkauth +=head2 checkauth ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type); @@ -428,8 +423,6 @@ END { } # module clean-up code here (global destructor) 1; __END__ -=back - =head1 SEE ALSO CGI(3) diff --git a/docs/CAS/CASProxy/examples/koha_webservice.pl b/docs/CAS/CASProxy/examples/koha_webservice.pl index c0b5abe206..07bd4eacbd 100755 --- a/docs/CAS/CASProxy/examples/koha_webservice.pl +++ b/docs/CAS/CASProxy/examples/koha_webservice.pl @@ -26,9 +26,13 @@ =head1 CGI PARAMETERS +=over + =item PT The Proxy Ticket, needed for check_api_auth, that will try to make the CAS Server validate it. +=back + =cut use utf8; diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 3e4e9bb1af..6e9ea0b3ad 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -442,11 +442,11 @@ RECORD: while ( ) { if ($sourcetag < "010"){ if ($record->field($sourcetag)){ my $source = $record->field($sourcetag)->data(); - printf($idmapfh "%s|%s\n",$source,$biblionumber); + printf($idmapfh "%s|%s\n",$source,$biblionumber); } } else { my $source=$record->subfield($sourcetag,$sourcesubfield); - printf($idmapfh "%s|%s\n",$source,$biblionumber); + printf($idmapfh "%s|%s\n",$source,$biblionumber); } } # create biblio, unless we already have it ( either match or isbn ) diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index 3719878a71..0598bc209d 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -379,13 +379,13 @@ sub parametrize { ; } elsif (defined $params[$i - 1]) { my $param = $params[$i - 1]; - warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a " - . $param->type->to_string . "\n", undef) - if $param->type != C4::TmplTokenType::DIRECTIVE; - warn_normal("$fmt_0: $&: Unsupported " - . "field width or precision\n", undef) + warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a " + . $param->type->to_string . "\n", undef) + if $param->type != C4::TmplTokenType::DIRECTIVE; + warn_normal("$fmt_0: $&: Unsupported " + . "field width or precision\n", undef) if defined $width || defined $prec; - warn_normal("$fmt_0: $&: Parameter $i not known", undef) + warn_normal("$fmt_0: $&: Parameter $i not known", undef) unless defined $param; $it .= defined $f? &$f( $param ): $param->string; } @@ -396,27 +396,27 @@ sub parametrize { my $param = $params[$i - 1]; if (!defined $param) { - warn_normal("$fmt_0: $&: Parameter $i not known", undef); + warn_normal("$fmt_0: $&: Parameter $i not known", undef); } else { if ($param->type == C4::TmplTokenType::TAG && $param->string =~ /^attributes? lc($param->attributes->{'type'}->[1]): undef; if ($conv eq 'S') { - warn_normal("$fmt_0: $&: Expected type=text, " - . "but found type=$type", undef) + warn_normal("$fmt_0: $&: Expected type=text, " + . "but found type=$type", undef) unless $type eq 'text'; } elsif ($conv eq 'p') { - warn_normal("$fmt_0: $&: Expected type=radio, " - . "but found type=$type", undef) + warn_normal("$fmt_0: $&: Expected type=radio, " + . "but found type=$type", undef) unless $type eq 'radio'; } } else { - warn_normal("$&: Expected an INPUT, but found a " - . $param->type->to_string . "\n", undef) + warn_normal("$&: Expected an INPUT, but found a " + . $param->type->to_string . "\n", undef) } - warn_normal("$fmt_0: $&: Unsupported " - . "field width or precision\n", undef) + warn_normal("$fmt_0: $&: Unsupported " + . "field width or precision\n", undef) if defined $width || defined $prec; $it .= defined $f? &$f( $param ): $param->string; } @@ -439,7 +439,7 @@ sub parametrize { my $i = $1; $fmt = $'; my $anchor = $anchors[$i - 1]; - warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME + warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME unless defined $anchor; $it .= $anchor->string; } else { diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index f3ebb7bb03..afac244c6c 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -275,13 +275,13 @@ sub convert_translation_file { $translation{$msgid} = $msgstr unless $msgstr eq '*****'; if ($msgid =~ /\bcharset=(["']?)([^;\s"']+)\1/s) { - my $candidate = TmplTokenizer::charset_canon($2); + my $candidate = TmplTokenizer::charset_canon($2); die "Conflicting charsets in msgid: $candidate vs $charset_in\n" if defined $charset_in && $charset_in ne $candidate; $charset_in = $candidate; } if ($msgstr =~ /\bcharset=(["']?)([^;\s"']+)\1/s) { - my $candidate = TmplTokenizer::charset_canon($2); + my $candidate = TmplTokenizer::charset_canon($2); die "Conflicting charsets in msgid: $candidate vs $charset_out\n" if defined $charset_out && $charset_out ne $candidate; $charset_out = $candidate; @@ -289,8 +289,8 @@ sub convert_translation_file { } # The following assumption is correct; that's what HTML::Template assumes if (!defined $charset_in) { - $charset_in = $charset_out = TmplTokenizer::charset_canon('utf-8'); - warn "Warning: Can't determine original templates' charset, defaulting to $charset_in\n"; + $charset_in = $charset_out = TmplTokenizer::charset_canon('utf-8'); + warn "Warning: Can't determine original templates' charset, defaulting to $charset_in\n"; } } @@ -383,7 +383,7 @@ if (defined $files_from) { my $input = /^\//? $_: "$directory/$_"; my $h = TmplTokenizer->new( $input ); $h->set_allow_cformat( 1 ); - VerboseWarnings::set_input_file_name($input); + VerboseWarnings::set_input_file_name($input); print STDERR "$0: Processing file \"$input\"\n" if $verbose_p; text_extract( $h ); } diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index e2f6989f71..63bdd6db1f 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -242,7 +242,7 @@ sub calculate { $columns{($row[0] ||'NULL')}++; push @loopcol, { coltitle => $row[0] || 'NULL' }; } - $debug and print $debugfh "full array: ", Dumper(\%columns), "\n"; + $debug and print $debugfh "full array: ", Dumper(\%columns), "\n"; }else{ $columns{''} = 1; } diff --git a/t/db_dependent/LDAP/test_ldap_add.pl b/t/db_dependent/LDAP/test_ldap_add.pl index c64186d253..3258a0397a 100755 --- a/t/db_dependent/LDAP/test_ldap_add.pl +++ b/t/db_dependent/LDAP/test_ldap_add.pl @@ -46,7 +46,7 @@ sub hashup { } sub recursive_breakdown { - my $dse = shift or return; + my $dse = shift or return; if (ref($dse) =~ /HASH/) { return join "\n", map {"$_\t=> " . recursive_breakdown($dse->{$_})} keys %$dse; } elsif (ref($dse) =~ /ARRAY/) { diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 53b8121b89..fe40f84c7e 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -427,8 +427,8 @@ foreach my $tag (sort keys %{$tagslib}) { $subfield_data{marc_lib} ="{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}.""; $subfield_data{mandatory} = $tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable}; - my $value; - if ( $use_default_values) { + my $value; + if ( $use_default_values) { $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; # get today date & replace YYYY, MM, DD if provided in the default value my $today = dt_from_string; -- 2.39.5