Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MooseX-NonMoose CPAN distribution.

Report information
The Basics
Id: 65221
Status: resolved
Priority: 0/
Queue: MooseX-NonMoose

People
Owner: Nobody in particular
Requestors: ac0v [...] sys-network.de
Cc:
AdminCc:

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



Subject: MooseX::NonMoose::Meta::Role::Class broken if new not existant
MooseX::NonMoose::Meta::Role::Class dies if the class which uses MooseX::NonMoose has no method "new" with eg, --snip-- Can't call method "isa" on an undefined value at /usr/local/share/perl/5.10.1/MooseX/NonMoose/Meta/Role/Class.pm line 40. --snap-- The following code: return @options if $self->get_method('new')->isa('Class::MOP::Method::Wrapped'); should be changed to use $metaclass->has_method to check first or using $metaclass->find_method_by_name if your intention for new is to be in a superclass. I think this method should never die if the method new is not existant. Maybe you could add a warning, that it may doesn't work as expected, if no new method can be found. Most info/text parts were originally written by Alejandrpo Imass, see http://article.gmane.org/gmane.comp.web.catalyst.general/25951
I stumbled upon the same problem as well when using a DBIx::Class::Schema in a package as its base (automatically generated schema/model by Catalyst) which has broken my application. I've tried to use the same module versions that I'm running on my production server (Moose 1.15, MooseX::NonMoose 0.16) as well as Moose 1.21 and MooseX::NonMoose 0.17. But these all generate the same error messages for me. I believe Moose uses Class:MOP and on production I'm running 1.09. On my dev machine I'm running 1.12. I've tried downgrading to 1.09 but that resulted into many errors. Hope this helps a bit.
I've also tried to see if this error would pop up on a fresh install of Strawberry Perl 5.12.2 and the latest versions of all dependencies. It did. Creating a dummy 'new' method in the DBIx::Class::Schema derived module fixes the problem for me, as was written by Alejandrpo Imass.
Fixed in 0.19.