Skip Menu |

This queue is for tickets about the Catalyst-Controller-ActionRole CPAN distribution.

Report information
The Basics
Id: 90972
Status: resolved
Priority: 0/
Queue: Catalyst-Controller-ActionRole

People
Owner: Nobody in particular
Requestors: upasna.shukla [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.16



Subject: New Moose may break your code
Date: Fri, 29 Nov 2013 03:39:14 +0530
To: bug-Catalyst-Controller-ActionRole [...] rt.cpan.org
From: "Upasana Shukla" <upasna.shukla [...] gmail.com>
We recently deprecated Class::MOP::load_class in Moose. It appears that your module is affected. You can read more about the change here: https://metacpan.org/pod/release/ETHER/Moose-2.1106-TRIAL/lib/Moose/Manual/Delta.pod#pod2.1200 We recommend that you take a look at your code to see if it indeed does need to be updated with respect to the latest Moose release, 2.1106-TRIAL. If you have any questions, then please ask either on Moose mailing list : http://lists.perl.org/list/moose.html or on #moose & #moose-dev on irc.perl.org.
As I don't see a function in Module::Runtime corresponding to load_first_existing_class, I've prepared a patch that calls Class::Load directly rather than using the wrapper functions.
Subject: class_load_RT90972.patch
--- lib/Catalyst/Controller/ActionRole.pm +++ lib/Catalyst/Controller/ActionRole.pm @@ -8,7 +8,7 @@ # ABSTRACT: Apply roles to action instances use Moose; -use Class::MOP; +use Class::Load; use Catalyst::Utils; use Moose::Meta::Class; use String::RewritePrefix 0.004; @@ -47,7 +47,7 @@ sub _build__action_roles { my $self = shift; my @roles = $self->_expand_role_shortname($self->_action_role_args); - Class::MOP::load_class($_) for @roles; + Class::Load::load_class($_) for @roles; return \@roles; } @@ -66,7 +66,7 @@ my @roles = $self->gather_action_roles(%args); return $self->$orig(%args) unless @roles; - Class::MOP::load_class($_) for @roles; + Class::Load::load_class($_) for @roles; my $action_class = $self->_build_action_subclass( $self->action_class(%args), @roles, @@ -116,7 +116,7 @@ return String::RewritePrefix->rewrite( { '' => sub { - my $loaded = Class::MOP::load_first_existing_class( + my $loaded = Class::Load::load_first_existing_class( map { "$_$_[0]" } @prefixes ); return first { $loaded =~ /^$_/ }
Submitted this as a pull request to github repo.
Yep. Currently can't build against the new Moose: t/action-class.t produces a LARGE stack trace: t/action-class.t .. Class::MOP::load_class is deprecated at /usr/local/cpanel/3rdparty/perl/514/lib/perl5/cpanel_lib/i386-linux-64int/Class/MOP.pm line 73. Class::MOP::load_class("TestApp::ActionRole::Kooh") called at /home/rpmbuild/rpm-build/BUILD/Catalyst-Controller-ActionRole-0.15/blib/lib/Catalyst/Controller/ActionRole.pm line 50 Catalyst::Controller::ActionRole::_build__action_roles(TestApp::Controller::Bar=HASH(0x91cf708)) called at native delegation method Catalyst::Controller::ActionRole::_action_roles (elements) of attribute _action_roles (defined at /home/rpmbuild/rpm-build/BUILD/Catalyst-Controller-ActionRole-0.15/blib/lib/Catalyst/Controller/ActionRole.pm line 37) line 8 Catalyst::Controller::ActionRole::_action_roles(TestApp::Controller::Bar=HASH(0x91cf708)) called at ... main::BEGIN() called at /home/rpmbuild/rpm-build/BUILD/Catalyst-Controller-ActionRole-0.15/t/lib/TestApp.pm line 0 eval {...} called at /home/rpmbuild/rpm-build/BUILD/Catalyst-Controller-ActionRole-0.15/t/lib/TestApp.pm line 0 ok 1 ok 2 ok 3 ok 4 1..4 ok All tests successful. Files=1, Tests=4, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.75 cusr 0.03 csys = 0.81 CPU) Result: PASS
On 2014-01-21 17:01:31, SPACEBAT wrote: Show quoted text
> Submitted this as a pull request to github repo.
This was https://github.com/rafl/catalyst-controller-actionrole/pull/3, and it has been merged/released.