Skip Menu |

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

Report information
The Basics
Id: 49507
Status: resolved
Priority: 0/
Queue: MooseX-Object-Pluggable

People
Owner: ether [...] cpan.org
Requestors: Jeremy [...] marzhillstudios.com
Cc:
AdminCc:

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



Subject: Moose::Meta::Class api change broke override method modifier checking
get_override_method_modifiers appears to be gone in recent versions of Moose ::Meta::Class. This breaks the override modifier warning code in MooseX::Object::Pluggable.
Are you sure that your plugin is a Moose::Role and not a Moose class? I made the same mistake and fixed it by making my plugin a role. This is what the synopsis suggests is the correct usage.
Subject: [Patch] Moose::Meta::Class api change broke override method modifier checking
On 2009-09-08 06:17:41, ZAPHAR wrote: Show quoted text
> get_override_method_modifiers appears to be gone in recent versions of > Moose ::Meta::Class. This breaks the override modifier warning code in > MooseX::Object::Pluggable.
I have also experienced that very problem, the cause is, as apeiron, pointed out that your plugin does not 'use Moose::Role' which means you don't have access to meta- Show quoted text
>get_override_method_modifiers as only roles have that.
I have attached a patch that gives a better error message and tells you how to fix the problem. -- Best regards, David Jack Olrik <david@olrik.dk> http://david.olrik.dk GnuPG fingerprint C290 0A4A 0CCC CBA8 2B37 E18D 01D2 F6EF 2E61 9894 ["The first rule of Perl club is You do not talk about Perl club"]
Subject: MooseX-Object-Pluggable-0.0011.patch
diff -NurB MooseX-Object-Pluggable-0.0011.orig/lib/MooseX/Object/Pluggable.pm MooseX-Object-Pluggable-0.0011/lib/MooseX/Object/Pluggable.pm --- MooseX-Object-Pluggable-0.0011.orig/lib/MooseX/Object/Pluggable.pm 2009-04-27 21:29:50.000000000 +0200 +++ MooseX-Object-Pluggable-0.0011/lib/MooseX/Object/Pluggable.pm 2011-01-04 15:22:59.000000000 +0100 @@ -234,6 +234,9 @@ eval { Class::MOP::load_class($role) }; confess("Failed to load role: ${role} $@") if $@; + croak("Your plugin '$role' must be a Moose::Role") + unless $role->isa('Moose::Role'); + carp("Using 'override' is strongly discouraged and may not behave ". "as you expect it to. Please use 'around'") if scalar keys %{ $role->meta->get_override_method_modifiers_map };
patched; will be in 0.0013