[Catalyst] Re: Warnings when upgrading Catalyst
Tomas Doran
bobtfish at bobtfish.net
Sun Jun 28 14:42:37 GMT 2009
On 26 Jun 2009, at 21:41, George Nistorica wrote:
> Hi,
>
> (my reply might be garbled, sorry)
Makes perfect sense here.
> I've got the same problem generated from a Controller that uses
> Controller::REST as a base class.
>
> And the warning being generated when I ->forward() to another
> Controller
> (doing some data validation).
Hmm, I can't replicate this in a simple case, from that description..
> I've got around this warning by editing Catalyst.pm and adding this
> piece of code
>
> if ( not exists $c->counter->{"$parent"}
> or not defined $c->counter->{"$parent"} )
> {
> $c->counter->{"$parent"} = 0;
> }
>
> right before the undefined value is used:
>
> $c->stats->profile(
> begin => $action,
> parent => "$parent" . $c->counter->{"$parent"},
> uid => $uid,
> );
>
> that worked for me, and now the debug output shows the profiling
> for the
> methods I ->forward() to as well:
>
> the methods from another Controller to which I forward to, where
> missing
> from the profiling output, getting that warning instead.
That looks like a prefect fix to me, but I'd _really_ like to get to
the bottom of what is causing the issue, so that we can write tests
of some form, and also because this could be hiding a bug at another
layer which should be fixed :/
Are you forwarding to a private path string, or an action object?
I guess extracting _just_ the structure of your controllers (without
any of the code, just the sub/attribute declerations), and ensuring
your doing the appropriate forwards that your app would be doing
would replicate the issue in a TestApp.
Don't suppose you could attempt that, so that we can find the root
cause, and get this fix integrated?
Cheers
t0m
More information about the Catalyst
mailing list