Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: DAVEWOOD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: circular reference detected.
I have a Catalyst app that uses a DBIx::Class schema with a DBIx-Class-InflateColumn-Object-Enum column. if I remove the object-enum type and make it a varchar instead the circular reference is gone. CatalystX::LeakChecker 2014-08-04 10:13:52 4812 Circular reference detected: .------------------------------------------------------------------------. | $a = $ctx->{stash}->{jobs}->{result_source}->{_columns}->{status}->{_- | | inflate_info}->{inflate}; | | code reference $a deparses to: sub { | | package DBIx::Class::InflateColumn::Object::Enum; | | use warnings; | | use strict; | | my $val = shift(); | | my $c = {'values', $values}; | | $$c{'unset'} = $$info{'is_nullable'} if exists $$info{'is_nullabl- | | e'} and $$info{'is_nullable'}; | | $$c{'default'} = $$info{'default_value'} if exists $$info{'defaul- | | t_value'}; | | my $e = 'Object::Enum'->new($c); | | $e->value($val); | | return $e; | | }; | | ${ $info } | '------------------------------------------------------------------------'
Can you give me your example code rather than just LeakChecker's output? On Mon Aug 04 04:54:56 2014, DAVEWOOD wrote: Show quoted text
> I have a Catalyst app that uses a DBIx::Class schema with a DBIx- > Class-InflateColumn-Object-Enum column. > > if I remove the object-enum type and make it a varchar instead the > circular reference is gone. > > > CatalystX::LeakChecker > > 2014-08-04 10:13:52 4812 Circular reference detected: > .------------------------------------------------------------------------ > . > | $a = $ctx->{stash}->{jobs}->{result_source}->{_columns}->{status}- > | >{_- | > | inflate_info}->{inflate}; > | | > | code reference $a deparses to: sub { > | | > | package DBIx::Class::InflateColumn::Object::Enum; > | | > | use warnings; > | | > | use strict; > | | > | my $val = shift(); > | | > | my $c = {'values', $values}; > | | > | $$c{'unset'} = $$info{'is_nullable'} if exists > | $$info{'is_nullabl- | > | e'} and $$info{'is_nullable'}; > | | > | $$c{'default'} = $$info{'default_value'} if exists > | $$info{'defaul- | > | t_value'}; > | | > | my $e = 'Object::Enum'->new($c); > | | > | $e->value($val); > | | > | return $e; > | | > | }; > | | > | ${ $info } > | | > '------------------------------------------------------------------------ > '
i attached a catalyst example project that demonstrates the problem. (nevermind the project title :) ) tar xvvzf veganbook.tgz cd VeganBook ./script/veganbook_server.pl -d wget http://localhost:3000/ingredient/list # this is all the code there is. package VeganBook::Schema::Result::Ingredient; use strict; use warnings; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/ InflateColumn::Object::Enum Core /); __PACKAGE__->table('ingredients'); __PACKAGE__->add_columns( id => { data_type => 'int', is_numeric => 1, is_auto_increment => 1 }, name => { data_type => 'varchar', is_nullable => 0 }, content => { data_type => 'varchar', is_nullable => 0 }, glutenfree => { data_type => 'enum', is_enum => 1, default_value => 'no', extra => { list => [ qw/ yes no / ] }, }, ); __PACKAGE__->set_primary_key('id'); 1; On Mon Aug 04 15:28:36 2014, JMMILLS wrote: Show quoted text
> Can you give me your example code rather than just LeakChecker's output? > > On Mon Aug 04 04:54:56 2014, DAVEWOOD wrote:
> > I have a Catalyst app that uses a DBIx::Class schema with a DBIx- > > Class-InflateColumn-Object-Enum column. > > > > if I remove the object-enum type and make it a varchar instead the > > circular reference is gone. > > > > > > CatalystX::LeakChecker > > > > 2014-08-04 10:13:52 4812 Circular reference detected: > > .------------------------------------------------------------------------ > > . > > | $a = $ctx->{stash}->{jobs}->{result_source}->{_columns}->{status}- > > | >{_- | > > | inflate_info}->{inflate}; > > | | > > | code reference $a deparses to: sub { > > | | > > | package DBIx::Class::InflateColumn::Object::Enum; > > | | > > | use warnings; > > | | > > | use strict; > > | | > > | my $val = shift(); > > | | > > | my $c = {'values', $values}; > > | | > > | $$c{'unset'} = $$info{'is_nullable'} if exists > > | $$info{'is_nullabl- | > > | e'} and $$info{'is_nullable'}; > > | | > > | $$c{'default'} = $$info{'default_value'} if exists > > | $$info{'defaul- | > > | t_value'}; > > | | > > | my $e = 'Object::Enum'->new($c); > > | | > > | $e->value($val); > > | | > > | return $e; > > | | > > | }; > > | | > > | ${ $info } > > | | > > '------------------------------------------------------------------------ > > '
> >
Subject: veganbook.tgz
Download veganbook.tgz
application/x-compressed-tar 269.5k

Message body not shown because it is not plain text.

Animal free code samples! (joke). If I get a chance today I'll see if I can duplicate the bug. On Wed Aug 06 08:36:28 2014, DAVEWOOD wrote: Show quoted text
> i attached a catalyst example project that demonstrates the problem. > (nevermind the project title :) ) > > tar xvvzf veganbook.tgz > cd VeganBook > ./script/veganbook_server.pl -d > wget http://localhost:3000/ingredient/list > > > > # this is all the code there is. > > package VeganBook::Schema::Result::Ingredient; > use strict; > use warnings; > use base qw/DBIx::Class/; > > __PACKAGE__->load_components(qw/ InflateColumn::Object::Enum Core /); > __PACKAGE__->table('ingredients'); > __PACKAGE__->add_columns( > id => { > data_type => 'int', > is_numeric => 1, > is_auto_increment => 1 > }, > name => { data_type => 'varchar', is_nullable => 0 }, > content => { data_type => 'varchar', is_nullable => 0 }, > glutenfree => { > data_type => 'enum', > is_enum => 1, > default_value => 'no', > extra => { > list => [ > qw/ > yes > no > / > ] > }, > }, > > ); > > __PACKAGE__->set_primary_key('id'); > > 1; > > > > > On Mon Aug 04 15:28:36 2014, JMMILLS wrote:
> > Can you give me your example code rather than just LeakChecker's > > output? > > > > On Mon Aug 04 04:54:56 2014, DAVEWOOD wrote:
> > > I have a Catalyst app that uses a DBIx::Class schema with a DBIx- > > > Class-InflateColumn-Object-Enum column. > > > > > > if I remove the object-enum type and make it a varchar instead the > > > circular reference is gone. > > > > > > > > > CatalystX::LeakChecker > > > > > > 2014-08-04 10:13:52 4812 Circular reference detected: > > > .------------------------------------------------------------------------ > > > . > > > | $a = $ctx->{stash}->{jobs}->{result_source}->{_columns}-
> > > >{status}-
> > > | >{_- | > > > | inflate_info}->{inflate}; > > > | | > > > | code reference $a deparses to: sub { > > > | | > > > | package DBIx::Class::InflateColumn::Object::Enum; > > > | | > > > | use warnings; > > > | | > > > | use strict; > > > | | > > > | my $val = shift(); > > > | | > > > | my $c = {'values', $values}; > > > | | > > > | $$c{'unset'} = $$info{'is_nullable'} if exists > > > | $$info{'is_nullabl- | > > > | e'} and $$info{'is_nullable'}; > > > | | > > > | $$c{'default'} = $$info{'default_value'} if exists > > > | $$info{'defaul- | > > > | t_value'}; > > > | | > > > | my $e = 'Object::Enum'->new($c); > > > | | > > > | $e->value($val); > > > | | > > > | return $e; > > > | | > > > | }; > > > | | > > > | ${ $info } > > > | | > > > '------------------------------------------------------------------------ > > > '
> > > >