Subject: | error in register_column |
Date: | Fri, 28 Feb 2014 17:05:41 +0000 |
To: | bug-DBIx-Class-InflateColumn-Object-Enum [...] rt.cpan.org |
From: | Frank Schwach <fs5 [...] sanger.ac.uk> |
Trying to set a default value that is not in the list of enum values, throws this error for me:
Not a HASH reference at [...]/site_perl/5.14.2/DBIx/Class/InflateColumn/Object/Enum.pm line 99.
with DBIx::Class::InflateColumn::Object::Enum version 0.04
and perl 5.14.2
Looking at the source, this is due this line ( ==HERE==>)
my $values = $info->{extra}->{list};
my %values = map {$_=>1} @{$values};
if ( defined($info->{default_value}) && !exists $values{$info->{default_value}}) {
push(@{$values},$info->{default_value});
==HERE==> $values->{$info->{default_value}} = 1;
}
indeed, $values is an ArrayRef, the line should be
$values{ $info->{default_value}} = 1
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.