[Dbix-class] [DBIx::Class] problems after update of Loader to 03003

Matt S Trout dbix-class at trout.me.uk
Fri Jun 30 17:58:31 CEST 2006


Daniel McBrearty wrote:
> hi
> 
> few probs since updating this module :
> 
> 1. I used to use load_from_connection in Schema.pm ... now I get a
> warning, it's deprecated. OK, so I change to the new way ... :
> 
> my $schema = My::Schema->connect( .... );
> 
> and I get an error:
> 
> Can't use an undefined value as a HASH reference at
> /usr/local/share/perl/5.8.7/DBIx/Class/Schema/Loader.pm line 154.
> 
> doesn't mean much to me. any clues what could cause this?
> 
> (The relevant source in Loader is:
> 
> sub clone {
>     my $self = shift;
> 
>     my $clone = $self->next::method(@_);
> 
>     $clone->_loader_args($self->_loader_args);
>     $clone->_loader_args->{schema} = $clone;
>     weaken($clone->_loader_args->{schema});
> 
>     $clone;
> }
> 
> to save you looking ... )
> 
> 2. if I go back to load_from_connection and ignore the warning,
> classes load OK, as before. BUT it seems as if in my old code:
> 
> my $schema = "My::Schema";
> $schema->storage->on_connect_do(["SET NAMES 'utf8'"]);
> 
> it now looks as if the "set names utf8" is not happening (I get some
> utf8 errors later). This was definitely OK before the update.

Did you set the loader options first? If you didn't that may be why 
_loader_args is undefined.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list