summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--C4/Letters.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/C4/Letters.pm b/C4/Letters.pm
index 4acc931..519c0f6 100644
--- a/C4/Letters.pm
+++ b/C4/Letters.pm
@@ -649,13 +649,16 @@ sub _parseletter {
#BZ 9886: Assuming that we want to eliminate ISBD punctuation here
#Therefore adding the test on biblio. This includes biblioitems,
#but excludes items. Removed unneeded global and lookahead.
$val = GetAuthorisedValueByCode ('ROADTYPE', $val, 0) if $table=~/^borrowers$/ && $field=~/^streettype$/;
my $replacedby = defined ($val) ? $val : '';
- if ( $replacedby and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) {
+ if ( $replacedby
+ and not $replacedby =~ m|0000-00-00|
+ and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| )
+ {
# If the value is XXXX-YY-ZZ[ AA:BB:CC] we assume it is a date
my $dateonly = defined $1 ? 0 : 1; #$1 refers to the capture group wrapped in parentheses. In this case, that's the hours, minutes, seconds.
eval {
$replacedby = output_pref({ dt => dt_from_string( $replacedby ), dateonly => $dateonly });
};
warn "$replacedby seems to be a date but an error occurs on generating it ($@)" if $@;