sort controllers in setup_actions
Matt S Trout [Sat, 3 Sep 2016 18:16:25 +0000 (18:16 +0000)]
Changes
lib/Catalyst/Dispatcher.pm

diff --git a/Changes b/Changes
index 5aa6778..5a70eef 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+  - Sort controllers in setup_actions so cross-controller precedence is
+    consistent.
+
 5.90112 - 2016-07-25
   - Spelling fixes from Debian group.
   - Fixed regression introduced in last release that caused the code to crap out
index d64b17e..c51510e 100644 (file)
@@ -620,7 +620,7 @@ sub setup_actions {
       $self->_load_dispatch_types( @{ $self->preload_dispatch_types } );
     @{ $self->_registered_dispatch_types }{@classes} = (1) x @classes;
 
-    foreach my $comp ( values %{ $c->components } ) {
+    foreach my $comp ( map @{$_}{sort keys %$_}, $c->components ) {
         $comp = $comp->() if ref($comp) eq 'CODE';
         $comp->register_actions($c) if $comp->can('register_actions');
     }