Bug 21395: (QA follow-up) Remove some introduced issues

This patch removes some new error cases introduced during rebase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e968af4377)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2020-06-25 11:31:49 +01:00 committed by Lucas Gass
parent 7f89ea6e18
commit 41fb8527b1
8 changed files with 38 additions and 41 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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 )

View File

@ -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 =~ /^<input\b/is) {
my $type = defined $param->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 {

View File

@ -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 );
}

View File

@ -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;
}

View File

@ -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/) {

View File

@ -427,8 +427,8 @@ foreach my $tag (sort keys %{$tagslib}) {
$subfield_data{marc_lib} ="<span id=\"error$i\" title=\"".$tagslib->{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}."</span>";
$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;