From: Matt S Trout Date: Sat, 3 Sep 2016 18:16:25 +0000 (+0000) Subject: sort controllers in setup_actions X-Git-Tag: 5.90113~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d7325e05db00f4eff6b1520368c9c2bda5ab931c sort controllers in setup_actions --- diff --git a/Changes b/Changes index 5aa6778..5a70eef 100644 --- 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 diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index d64b17e..c51510e 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -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'); }