[Dbix-class] Error on sub class

Mitchell Elutovich melutovich at gmail.com
Fri Jan 16 10:41:44 GMT 2015


$perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for
x86_64-linux-thread-multi

$ perl -MDBIx::Class -le 'print $DBIx::Class::VERSION'
0.082810

Anyone know why I might be now running into this?  I'm not sure how long
this problem has existed and I thought I was originally using the sub class
ok.

[2015/01/16 10:29:03] ERROR VLjn2099aP8AAFDcB7sAAAAA View/TT.pm:245
Catalyst.View.TT - Couldn't render template "xxx/yyy/index.tt2: undef error
- DBIx::Class::ResultSource::_resolve_relationship_condition(): Arg\
ument 'self_result_object' must be an object of class
'CatTxA::Model::DB::Document' at
/mnt/ext1/melutovich/cvc/repo/CatTxA/script/../lib/CatTxA/Schema/Document.pm
line 716
"

Line 716 is like:
    my $result = $doc->documenttypecd->doSomething();


At the beginning of Document.pm I've got.

my ($xxxDocumentTypeCd) = (qw(XXX));
my $xxxSubClass = __PACKAGE__ . '::' . $xxxDocumentTypeCd;
sub inflate_result {
    my $self = shift;
    my $ret = $self->next::method(@_);
    my $documentTypeCd = $ret->documentTypeCd;
    given ($documentTypeCd) {
        when( $xxxDocumentTypeCd ) {
            $self->ensure_class_loaded( $xxxSubClass );
            bless ($ret, $xxxSubClass);
        }
        default {
            bless ($ret, $self);
        }
    }
    return $ret;
}


thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20150116/3a3b1b69/attachment-0001.htm>


More information about the DBIx-Class mailing list