projects
/
koha-bibliografija
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5932740
)
check year validity and report invalid_year in $skip
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 24 Nov 2013 22:19:16 +0000
(23:19 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 24 Nov 2013 22:19:16 +0000
(23:19 +0100)
html.pl
patch
|
blob
|
history
diff --git
a/html.pl
b/html.pl
index
ef041d2
..
84d54e2
100755
(executable)
--- a/
html.pl
+++ b/
html.pl
@@
-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') {