From: Peter Rabbitson Date: Sun, 21 Mar 2010 06:52:01 +0000 (+0000) Subject: Fix IC::DT to stop autovivifying columninfo keys X-Git-Tag: v0.08124~111 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c2ffef943bebdfb33eaf7217f171cb7fcfbced8;p=dbsrgits%2FDBIx-Class.git Fix IC::DT to stop autovivifying columninfo keys --- diff --git a/lib/DBIx/Class/InflateColumn/DateTime.pm b/lib/DBIx/Class/InflateColumn/DateTime.pm index 0c5fa92..dda4a10 100644 --- a/lib/DBIx/Class/InflateColumn/DateTime.pm +++ b/lib/DBIx/Class/InflateColumn/DateTime.pm @@ -138,16 +138,18 @@ sub register_column { } } - if ( defined $info->{extra}{timezone} ) { - carp "Putting timezone into extra => { timezone => '...' } has been deprecated, ". - "please put it directly into the '$column' column definition."; - $info->{timezone} = $info->{extra}{timezone} unless defined $info->{timezone}; - } + if ($info->{extra}) { + if ( defined $info->{extra}{timezone} ) { + carp "Putting timezone into extra => { timezone => '...' } has been deprecated, ". + "please put it directly into the '$column' column definition."; + $info->{timezone} = $info->{extra}{timezone} unless defined $info->{timezone}; + } - if ( defined $info->{extra}{locale} ) { - carp "Putting locale into extra => { locale => '...' } has been deprecated, ". - "please put it directly into the '$column' column definition."; - $info->{locale} = $info->{extra}{locale} unless defined $info->{locale}; + if ( defined $info->{extra}{locale} ) { + carp "Putting locale into extra => { locale => '...' } has been deprecated, ". + "please put it directly into the '$column' column definition."; + $info->{locale} = $info->{extra}{locale} unless defined $info->{locale}; + } } my $undef_if_invalid = $info->{datetime_undef_if_invalid};