Skip Menu |

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

Report information
The Basics
Id: 58057
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: bobtfish [...] bobtfish.net
Requestors: onken [...] netcubed.de
Cc:
AdminCc:

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



Subject: Wrong metaclass on controller actions
After upgrading to Moose 1.05 from 1.03 the following stopped working: package TestApp::Controller::Moose::NoAttributes; use Moose; extends qw/Catalyst::Controller/; __PACKAGE__->config( actions => { test => { Local => undef } } ); sub test { } 1; It dies at compile time with: Couldn't load class (TestApp) because: Can't locate object method "attributes" via package "Moose::Meta::Method" ... Failing test and (workaround) fix at http://paste.scsys.co.uk/44331. Putting "extends" into a BEGIN block fixes the problem as well.
Test case in Catalyst in r13354. Test case in MooseX::MethodAttributes commit f27147d.
I have applied your patch due to lack of time to investigate the upstream regression properly, and it's released in Catalyst-Runtime 5.80025. I'm going to keep this RT open till we have it fix 'properly' upstream also.
On Wed Jul 28 21:00:21 2010, BOBTFISH wrote: Show quoted text
> I have applied your patch due to lack of time to investigate the > upstream regression properly, and it's released in Catalyst-Runtime
5.80025. Show quoted text
> > I'm going to keep this RT open till we have it fix 'properly' upstream
also. Only methods with at least one actual attribute should be usable as actions. Your original posted code should not work, and if it ever did that's a bug that's been introduced into Catalyst. The canonical way to handle this is to write: sub foo :Action { to indicate that a method is permitted to have attributes set on it via config. a bare 'sub foo {' should never be an action since this would allow the exposure of non-action methods by accident from myapp.conf