Skip Menu |

This queue is for tickets about the Catalyst-Model-MultiAdaptor CPAN distribution.

Report information
The Basics
Id: 90905
Status: open
Priority: 0/
Queue: Catalyst-Model-MultiAdaptor

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

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



Subject: New Moose may break your code
Date: Fri, 29 Nov 2013 03:34:10 +0530
To: bug-Catalyst-Model-MultiAdaptor [...] 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.
Attached patch fixes the issue. -- Cheers, ZZ [ https://metacpan.org/author/ZOFFIX ]
Subject: Catalyst-Model-MultiAdaptor-0.11.patch
diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst/Controller.pm Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst/Controller.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst/Controller.pm 2014-01-24 22:20:44.810600570 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst/Controller.pm 2014-01-24 22:21:48.702601408 -0500 @@ -2,6 +2,7 @@ package Catalyst::Controller; use Moose; +use Class::Load; use Moose::Util qw/find_meta/; use List::MoreUtils qw/uniq/; use namespace::clean -except => 'meta'; @@ -235,7 +236,7 @@ my $class = (exists $args{attributes}{ActionClass} ? $args{attributes}{ActionClass}[0] : $self->_action_class); - Class::MOP::load_class($class); + Class::Load::load_class($class); my $action_args = $self->config->{action_args}; my %extra_args = ( diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst/Test.pm Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst/Test.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst/Test.pm 2014-01-24 22:20:44.810600570 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst/Test.pm 2014-01-24 22:23:00.318602346 -0500 @@ -8,6 +8,7 @@ use Catalyst::Exception; use Catalyst::Utils; use Class::MOP; +use Class::Load; use Sub::Exporter; my $build_exports = sub { @@ -21,8 +22,8 @@ } elsif (! $class) { $request = sub { Catalyst::Exception->throw("Must specify a test app: use Catalyst::Test 'TestApp'") }; } else { - unless (Class::MOP::is_class_loaded($class)) { - Class::MOP::load_class($class); + unless (Class::Load::is_class_loaded($class)) { + Class::Load::load_class($class); } $class->import; diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst.pm Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/inc/Catalyst.pm 2014-01-24 22:20:44.810600570 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/inc/Catalyst.pm 2014-01-24 22:24:33.294603567 -0500 @@ -6,6 +6,7 @@ extends 'Catalyst::Component'; use Moose::Util qw/find_meta/; use B::Hooks::EndOfScope (); +use Class::Load; use Catalyst::Exception; use Catalyst::Exception::Detach; use Catalyst::Exception::Go; @@ -1485,7 +1486,7 @@ $dispatcher = $class->dispatcher_class; } - Class::MOP::load_class($dispatcher); + Class::Load::load_class($dispatcher); # dispatcher instance $class->dispatcher( $dispatcher->new ); @@ -1565,7 +1566,7 @@ $engine = $class->engine_class; } - Class::MOP::load_class($engine); + Class::Load::load_class($engine); # check for old engines that are no longer compatible my $old_engine; @@ -1680,7 +1681,7 @@ my ( $proto, $plugin, $instant ) = @_; my $class = ref $proto || $proto; - Class::MOP::load_class( $plugin ); + Class::Load::load_class( $plugin ); $class->log->warn( "$plugin inherits from 'Catalyst::Component' - this is decated and will not work in 5.81" ) if $plugin->isa( 'Catalyst::Component' ); $proto->_plugins->{$plugin} = 1; @@ -1705,7 +1706,7 @@ my @plugins = Catalyst::Utils::resolve_namespace($class . '::Plugin', 'Catalyst::Plugin', @$plugins); for my $plugin ( reverse @plugins ) { - Class::MOP::load_class($plugin); + Class::Load::load_class($plugin); my $meta = find_meta($plugin); next if $meta && $meta->isa('Moose::Meta::Role'); diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/inc/Test/WWW/Mechanize/Catalyst.pm Catalyst-Model-MultiAdaptor-0.11/inc/Test/WWW/Mechanize/Catalyst.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/inc/Test/WWW/Mechanize/Catalyst.pm 2014-01-24 22:20:44.810600570 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/inc/Test/WWW/Mechanize/Catalyst.pm 2014-01-24 22:23:34.030602789 -0500 @@ -8,6 +8,7 @@ use Encode qw(); use HTML::Entities; use Test::WWW::Mechanize; +use Class::Load; extends 'Test::WWW::Mechanize', 'Moose::Object'; @@ -67,8 +68,8 @@ unless ($ENV{CATALYST_SERVER}) { croak "catalyst_app attribute is required unless CATALYST_SERVER env variable is set" unless $self->has_catalyst_app; - Class::MOP::load_class($self->catalyst_app) - unless (Class::MOP::is_class_loaded($self->catalyst_app)); + Class::Load::load_class($self->catalyst_app) + unless (Class::Load::is_class_loaded($self->catalyst_app)); } } @@ -223,8 +224,8 @@ my ($class, $app) = @_; if (defined $app) { - Class::MOP::load_class($app) - unless (Class::MOP::is_class_loaded($app)); + Class::Load::load_class($app) + unless (Class::Load::is_class_loaded($app)); $APP_CLASS = $app; } diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/lib/Catalyst/Model/MultiAdaptor/Base.pm Catalyst-Model-MultiAdaptor-0.11/lib/Catalyst/Model/MultiAdaptor/Base.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/lib/Catalyst/Model/MultiAdaptor/Base.pm 2014-01-24 22:20:44.814600571 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/lib/Catalyst/Model/MultiAdaptor/Base.pm 2014-01-24 22:25:05.110603982 -0500 @@ -3,7 +3,7 @@ use warnings; use Carp; use Class::C3; -use Class::MOP; +use Class::Load; use Sub::Install; use Module::Pluggable::Object; use Catalyst::Model::MultiAdaptor::LifeCycle; @@ -70,7 +70,7 @@ sub _load_class { my ( $self, $adapted_class ) = @_; - Class::MOP::load_class($adapted_class); + Class::Load::load_class($adapted_class); } sub _create_instance { diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/lib/Catalyst/Model/MultiAdaptor/LifeCycle.pm Catalyst-Model-MultiAdaptor-0.11/lib/Catalyst/Model/MultiAdaptor/LifeCycle.pm --- Catalyst-Model-MultiAdaptor-0.11_orig/lib/Catalyst/Model/MultiAdaptor/LifeCycle.pm 2014-01-24 22:20:44.814600571 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/lib/Catalyst/Model/MultiAdaptor/LifeCycle.pm 2014-01-24 22:25:18.182604153 -0500 @@ -1,5 +1,6 @@ package Catalyst::Model::MultiAdaptor::LifeCycle; use Moose; +use Class::Load; has 'model_class_name' => ( is => 'ro', @@ -20,7 +21,7 @@ sub setup { my ( $class, $params ) = @_; my $class_name = $class . "::" . $params->{policy}; - Class::MOP::load_class($class_name); + Class::Load::load_class($class_name); my $lifecycle = $class_name->new( adapted_class => $params->{adapted_class}, model_class_name => $params->{model_class_name}, diff -Naur Catalyst-Model-MultiAdaptor-0.11_orig/Makefile.PL Catalyst-Model-MultiAdaptor-0.11/Makefile.PL --- Catalyst-Model-MultiAdaptor-0.11_orig/Makefile.PL 2014-01-24 22:20:44.810600570 -0500 +++ Catalyst-Model-MultiAdaptor-0.11/Makefile.PL 2014-01-24 22:25:33.610604355 -0500 @@ -7,6 +7,7 @@ qw/ Sub::Install Class::MOP + Class::Load MRO::Compat Module::Pluggable::Object Moose