X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=html.pl;h=2acc2dfc93d73fa033a99d29afb85f2edd0717e5;hb=ce063e6a340acac6f89d5a220ef78a9dd8f55a64;hp=ef041d24777fc9f24f8d5a71ec2a6a983dbe2cc6;hpb=59327403c1ef86af01e67daf50edadc86933d33f;p=koha-bibliografija diff --git a/html.pl b/html.pl index ef041d2..2acc2df 100755 --- a/html.pl +++ b/html.pl @@ -21,7 +21,7 @@ my $dbh = C4::Context->dbh; sub debug { my ($title, $data) = @_; - print "# $title ",dump($data), $/; + print "# $title ",dump($data), $/ if $ENV{DEBUG}; } my $xslfilename = 'compact.xsl'; @@ -155,7 +155,12 @@ while( my $row = $sth_select_authors->fetchrow_hashref ) { if ($elt->localname eq 'controlfield') { if ( $tag eq '008' ) { - $biblio_year->{ $row->{biblionumber} } = $data->{year} = substr($elt->textContent, 7, 4 ); + my $year = substr($elt->textContent, 7, 4 ); + if ( $year !~ m/^\d+$/ ) { + $year = 0; + push @{ $skip->{invalid_year} }, $row->{biblionumber}; + } + $biblio_year->{ $row->{biblionumber} } = $data->{year} = $year; } next; } elsif ($elt->localname eq 'datafield') {