Skip Menu |

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

Report information
The Basics
Id: 52297
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-AutoCRUD

People
Owner: OLIVER [...] cpan.org
Requestors: bobtfish [...] bobtfish.net
Cc:
AdminCc:

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



Subject: Demos fail spectacularly on Catalyst 5.80 if plugins have new methods...
Hiya. Looking at examples/demo/server.pl, the entire DemoApp package is included in the script. This has the unfortunate side effect that with Catalyst 5.80, the chunk of code beginning with the comment 'Make sure that the application class becomes immutable at this point' never gets run. This causes you to not get a Moose constructor (therefore getting the Class::Accessor::Fast one, which doesn't fill attribute defaults. This results in the error: [error] Caught exception in engine "Can't use an undefined value as an ARRAY reference at /Users/t0m/perl5/lib/perl5/Catalyst.pm line 1584." As $c->state is never initialized. There are three possible fixes for this: 1) Move DemoApp out into its own package (I guess you don't want to do this). 2) Test if the app is a Catalyst 5.80 app and force constructor inlining yourself. ( __PACKAGE__->meta->make_immutable(replace_constructor => 1) if __PACKAGE__->can('meta') ) 3) Just put the entire decleration of DemoApp inside a BEGIN { block, which causes the end of scope hook used by Catalyst to correctly fire and replace constructors _if_ needed.. Hope this explantion / solutions help! Note, this is related to: http://search.cpan.org/~flora/Catalyst-Runtime-5.80014/lib/Catalyst/Test.pm#INLINE_TESTS_WILL_NO_LONGER_WORK Cheers t0m
Hi t0m, On Mon Nov 30 19:04:11 2009, BOBTFISH wrote: Show quoted text
> Looking at examples/demo/server.pl, the entire DemoApp package is > included in the script.
I was just starting to look into this issue, and I am so totally grateful that you took the time to write this bug report and let me know what was happening. Show quoted text
> 1) Move DemoApp out into its own package (I guess you don't want to do > this).
Of the solutions presented this is actually the one I chose, seeming the least hacky (and that's saying something, for me). Version 0.67 of the plugin should be winging its way to a CPAN mirror. Thanks -so- much once again; I will try to buy you a beer if I make LPW this w/end. kindest regards, oliver.