Bug 30540: eval on set_time_zone

This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6dab34fe66)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 7a1001d8be)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Martin Renvoize 2022-04-14 09:14:47 +01:00 committed by Victor Grousset/tuxayo
parent ef14fdb18b
commit 6cf3f3bd55
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,7 @@ sub output_pref {
# FIXME: see bug 13242 => no TZ for dates 'infinite'
if ( $dt->ymd !~ /^9999/ ) {
my $tz = $dateonly ? DateTime::TimeZone->new(name => 'floating') : C4::Context->tz;
$dt->set_time_zone( $tz );
eval { $dt->set_time_zone( $tz ); }
}
my $pref =