Error on sub class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error on sub class

Mitchell Elutovich
$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.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error on sub class

Mitchell Elutovich
I've checked and my perl DBIX version is not as a quoted but rather is 0.08196


On Fri, Jan 16, 2015 at 5:41 AM, Mitchell Elutovich <[hidden email]> wrote:
$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.


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error on sub class

Mitchell Elutovich
Correction again.  I am seeing this with the latest DBIX version of 0.082810

On Fri, Jan 16, 2015 at 6:59 AM, Mitchell Elutovich <[hidden email]> wrote:
I've checked and my perl DBIX version is not as a quoted but rather is 0.08196


On Fri, Jan 16, 2015 at 5:41 AM, Mitchell Elutovich <[hidden email]> wrote:
$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.



_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error on sub class

Alexander Hartmaier
On 2015-01-19 00:47, Mitchell Elutovich wrote:
Correction again.  I am seeing this with the latest DBIX version of 0.082810
Note that the abbreviation for DBIx::Class ist DBIC, not DBIx which is a whole CPAN namespace.

On Fri, Jan 16, 2015 at 6:59 AM, Mitchell Elutovich <[hidden email]> wrote:
I've checked and my perl DBIX version is not as a quoted but rather is 0.08196


On Fri, Jan 16, 2015 at 5:41 AM, Mitchell Elutovich <[hidden email]> wrote:
$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.




_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error on sub class

Mitchell Elutovich
In reply to this post by Mitchell Elutovich
Petter if I remove the check (line 1909) everything else seems to behave sensibly.  Before you just go off and remove it I noticed that there is a little more going on here.


We are using Catalyst and it is called for simplicity YYY.  I just noticed that the error message is that it is expected a YYY::Model::DB::Document.pm, while the parent package name is YYY::Schema::Document.pm

On Mon, Jan 19, 2015 at 5:17 AM, Peter Rabbitson <[hidden email]> wrote:
On 01/16/2015 11:41 AM, Mitchell Elutovich wrote:
$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.

This is a new check that was introduced during the 0.0828xx series. It was introduced due to a lot of abuse-cases of the relationship system. Nevertheless in this case it seems like a false positive - i.e. your usage seems valid.

Can you please disable the exception-check in question in
DBIx::Class::ResultSource::_resolve_relationship_condition, and tell me if everything else seems to behave in a sensible manner?

If this is the case - I would have to remove this check going forward.


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Loading...