[Catalyst-commits] r10119 - in Catalyst-Runtime/5.80/trunk: . lib lib/Catalyst t/lib/TestApp/Controller

random at dev.catalyst.perl.org random at dev.catalyst.perl.org
Wed May 13 18:25:30 GMT 2009


Author: random
Date: 2009-05-13 18:25:30 +0000 (Wed, 13 May 2009)
New Revision: 10119

Added:
   Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Keyword.pm
Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm
Log:
Rename the actions attribute in Catalyt::Controller to _controller_actions to avoid name clashes with application controller naming. (random)

Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2009-05-13 18:15:18 UTC (rev 10118)
+++ Catalyst-Runtime/5.80/trunk/Changes	2009-05-13 18:25:30 UTC (rev 10119)
@@ -1,5 +1,7 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+        - Rename the actions attribute in Catalyt::Controller to _controller_actions to
+          avoid name clashes with application controller naming. (random)
         - Test for using Moose in components which have a non-Moose base class
           Fixed by 349cda in Moose 0.78 (t0m)
         - Fix deprecation message for Catalyst::Dispatcher to refer

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm	2009-05-13 18:15:18 UTC (rev 10118)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm	2009-05-13 18:25:30 UTC (rev 10119)
@@ -29,7 +29,7 @@
      predicate => 'has_action_namespace',
     );
 
-has actions =>
+has _controller_actions =>
     (
      is => 'rw',
      isa => 'HashRef',
@@ -41,7 +41,7 @@
     my $action  = delete $args->{action}  || {};
     my $actions = delete $args->{actions} || {};
     my $attr_value = $self->merge_config_hashes($actions, $action);
-    $self->actions($attr_value);
+    $self->_controller_actions($attr_value);
 }
 
 =head1 NAME
@@ -260,7 +260,7 @@
     # superior while mantaining really high degree of compat
     my $actions;
     if( ref($self) ) {
-        $actions = $self->actions;
+        $actions = $self->_controller_actions;
     } else {
         my $cfg = $self->config;
         $actions = $self->merge_config_hashes($cfg->{actions}, $cfg->{action});

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2009-05-13 18:15:18 UTC (rev 10118)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2009-05-13 18:25:30 UTC (rev 10119)
@@ -2748,6 +2748,8 @@
 
 rafl: Florian Ragwitz <rafl at debian.org>
 
+random: Roland Lammel <lammel at cpan.org>
+
 sky: Arthur Bergman
 
 the_jester: Jesse Sheidlower

Added: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Keyword.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Keyword.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Keyword.pm	2009-05-13 18:25:30 UTC (rev 10119)
@@ -0,0 +1,18 @@
+package TestApp::Controller::Keyword;
+
+use strict;
+use base 'Catalyst::Controller';
+
+#
+# Due to 'actions' being used as an attribute up to cat 5.80003 using this name
+# for an action causes a weird error, as this would be called during BUILD time
+# of the Catalyst::Controller class
+#
+
+sub actions : Local {
+    my ( $self, $c ) = @_;
+    die("Call to controller action method without context! Probably naming clash") unless $c;
+    $c->res->output("Test case for using 'actions' as a catalyst action name\n");
+}
+
+1;




More information about the Catalyst-commits mailing list