Skip Menu |

This queue is for tickets about the DBIx-Class-InflateColumn-Object-Enum CPAN distribution.

Report information
The Basics
Id: 93432
Status: resolved
Priority: 0/
Queue: DBIx-Class-InflateColumn-Object-Enum

People
Owner: jmmills [...] cpan.org
Requestors: fs5 [...] sanger.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.05-TRIAL



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.
Replicated the bug and fixed it, default value now auto adds to available enum fields