FAQ
Hey,

We are seeing a change to the behavior of $c->namespace in the latest Catalyst release. Previously, this method would return a value similar to $c->controller->action_namespace, but now it seems to return the namespace of whatever the last controller that handled the request was.

I am guessing the change comes from:

sub dispatch { # Execute ourselves against a context
my ( $self, $c ) = @_;
- local $c->namespace = $self->namespace;
+ local $c->{namespace} = $self->namespace;
return $c->execute( $self->class, $self );
}

Where we are no long localizing $c->namespace.

I'd just like to clarify this is the behavior we want and see if we can cook up a test for it. Is this giving anyone else trouble?

Sincerely,
John Napiorkowski

Search Discussions

  • Michele Beltrame at May 20, 2008 at 9:22 am
    Hi John!
    I'd just like to clarify this is the behavior we want and see if we can cook up a test for it. Is this giving anyone else trouble?
    It's giving me trouble, as $c->uri_for() uses $c->namespace for relative
    URIs.

    What happens with 5.7013 is that (for instance) when I'm in "patients/list"
    action path and I call from my templates something like:

    $c->uri_for('list/get');

    It's now translated into:

    http://localhost:3000/tt/list/get

    instead of the correct:

    http://localhost:3000/patients/list/get

    I don't know where that "tt" comes from, but reverting the line you
    posted of Action.pm to the 5.7012 version makes everything work again.

    Talk to you soon,
    Michele.

    --
    Michele Beltrame
    http://www.cattlegrid.info/
    ICQ 76660101 - MSN mb@italpro.net
  • Peter Karman at May 20, 2008 at 3:12 pm

    On 05/19/2008 06:04 PM, John Napiorkowski wrote:

    I'd just like to clarify this is the behavior we want and see if we can cook up a test for it. Is this giving anyone else trouble?
    Yes, this is biting my app too.

    --
    Peter Karman . peter@peknet.com . http://peknet.com/
  • Peter Karman at May 21, 2008 at 3:21 pm

    On 05/19/2008 06:04 PM, John Napiorkowski wrote:

    I'd just like to clarify this is the behavior we want and see if we can cook up a test for it. Is this giving anyone else trouble?
    FYI, I just sent a test patch exposing the problem to the catalyst-dev list.

    --
    Peter Karman . peter@peknet.com . http://peknet.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMay 20, '08 at 12:04a
activeMay 21, '08 at 3:21p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase