[Catalyst] Re: Warnings when upgrading Catalyst

George Nistorica george at depechemode.ro
Fri Jun 26 20:41:47 GMT 2009


(my reply might be garbled, sorry)

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).

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:

            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.

> Gah! I should really consider just giving up on Yahoo! Mail. Replying
> to HTML email is *painful* :( I hereby swallow the meme kool-aid and
> dub them Yahoo! FAIL.
> --- On Wed, 24/6/09, Tomas Doran <bobtfish[at]bobtfish.net> wrote:
> > From: Tomas Doran <bobtfish[at]bobtfish.net> Also, you're in debug
> > mode.. Do you get the warnings when debug mode is disabled?
> Cool! When I disable debug mode, the warnings go away. Never thought
> to look at that. This makes me feel much more confident that we don't
> have a bug in our code. Still, we run tests in debug mode and we don't
> want our test suite spewing warnings lest we start ignoring them.
> >   return if ( ( $code->name =~ /^_.*/ ) &&
> > (!$c->config->{show_internal_actions} )); So I guess you have
> > $c->config->{show_internal_actions} turned on then?
> No, that evaluates to undef. However, that doesn't apply because when
> the error occurs, $code->name is 'default', thus avoiding the second
> condition. I think the confusion stems from how the above code is
> written. This is clearer, I think:
>  return if ( $code->name =~ /^_/ and not
>  $c->config->{show_internal_actions} );
> > The $code->name when we get the warning is 'default', so I'm
> > assuming it's not considered a private action.  When we get to the
> > actual section of code which issues the warning (line 1561 in the
> > cpan distribution) I'm now wildly stabbing in the dark, but can you
> > try:
> >
> > which _may_ fix your issue, as the sub you're dealing with is called
> > 'default' and that has some fixes for that... This is merely a
> > guess, I don't pretend to really understand what's going on for you,
> > or why you're getting this.
> I tried to grab that, but our socks proxy won't allow this. If anyone
> is kind enough to send me a tarball, I'll happily give it a try and
> report what I find :)
> And no worries about stabs in the dark. I really appreciate the fact
> that you're taking the time to consider this.
> Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/
> Tech blog - http://use.perl.org/~Ovid/journal/ Twitter -
> http://twitter.com/OvidPerl Official Perl 6 Wiki -
> http://www.perlfoundation.org/perl6
> _______________________________________________ List:
> Catalyst[at]lists.scsys.co.uk Listinfo:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable
> archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

More information about the Catalyst mailing list