Merge branch 'master' into gsoc_breadboard
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Controller.pm
index 16b5a38..5b94aaa 100644 (file)
@@ -154,6 +154,12 @@ around action_namespace => sub {
 
     my $class = ref($self) || $self;
     my $appclass = ref($c) || $c;
+
+    # FIXME - catalyst_component_name is no longer a class accessor, because
+    # 'MyApp as a controller' behavior is removed. But is this call to
+    # catalyst_component_name necessary, or is it always the same as $class?
+    my $component_name = ref($self) ? $self->catalyst_component_name : $self;
+
     if( ref($self) ){
         return $self->$orig if $self->has_action_namespace;
     } else {
@@ -175,7 +181,7 @@ around action_namespace => sub {
         }
     }
 
-    my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name, $case_s) || '';
+    my $namespace = Catalyst::Utils::class2prefix($component_name, $case_s) || '';
     $self->$orig($namespace) if ref($self);
     return $namespace;
 };
@@ -321,7 +327,9 @@ sub _parse_attrs {
 
     %raw_attributes = (
         %raw_attributes,
-        exists $actions_config->{$name} ? %{ $actions_config->{$name } } : (),
+        # Note we deep copy array refs here to stop crapping on config
+        # when attributes are parsed. RT#65463
+        exists $actions_config->{$name} ? map { ref($_) eq 'ARRAY' ? [ @$_ ] : $_ } %{ $actions_config->{$name } } : (),
     );
 
     # Private actions with additional attributes will raise a warning and then
@@ -480,7 +488,7 @@ Sets 'path_prefix', as described below.
 
 Allows you to set the attributes that the dispatcher creates actions out of.
 This allows you to do 'rails style routes', or override some of the
-attribute defintions of actions composed from Roles.
+attribute definitions of actions composed from Roles.
 You can set arguments globally (for all actions of the controller) and
 specifically (for a single action).