Merge 'trunk' into 'more_metaclass_compat'
Tomas Doran [Thu, 20 May 2010 20:31:35 +0000 (20:31 +0000)]
r13205@t0mlaptop (orig r13169):  t0m | 2010-04-19 03:40:24 +0100
Document the action config here, as people don't seem to find it and this may help..
r13206@t0mlaptop (orig r13170):  t0m | 2010-04-19 03:41:57 +0100
Bah, accidentally removed..
r13207@t0mlaptop (orig r13171):  t0m | 2010-04-19 08:22:49 +0100
Go away useless warning
r13213@t0mlaptop (orig r13177):  ajgb | 2010-04-21 12:10:51 +0100
Fix not stripping backslashes in DispatchType::Regex::uri_for_action
r15483@t0mlaptop (orig r13190):  rafl | 2010-04-28 23:54:04 +0100
Make sure path_to returns an instance of the right Path::Class class.
r15484@t0mlaptop (orig r13191):  edenc | 2010-04-29 00:29:02 +0100
minor documentation fix for handle_request
r15489@t0mlaptop (orig r13193):  rafl | 2010-05-03 00:16:25 +0100
Allow parameterized roles to be applied as plugins.
r15490@t0mlaptop (orig r13194):  t0m | 2010-05-03 00:27:43 +0100
Back out crazy heuristics
r15492@t0mlaptop (orig r13196):  rafl | 2010-05-03 00:44:30 +0100
Unbreak tests by actually adding the module they're supposed to test.
r15494@t0mlaptop (orig r13198):  rafl | 2010-05-03 01:51:43 +0100
Remove useless conditional.
r15515@t0mlaptop (orig r13219):  wreis | 2010-05-06 13:34:10 +0100
make uri_for a bit cleaner
r15516@t0mlaptop (orig r13220):  wreis | 2010-05-06 14:30:19 +0100
minor fix for Changes file | add me as a contributor
r15517@t0mlaptop (orig r13221):  rafl | 2010-05-07 22:11:10 +0100
Pass along options to load_class for plugins.
r15518@t0mlaptop (orig r13222):  rafl | 2010-05-07 22:48:51 +0100
Changelogging.
r15519@t0mlaptop (orig r13223):  rafl | 2010-05-07 23:06:26 +0100
Version 5.80023.
r15535@t0mlaptop (orig r13239):  ribasushi | 2010-05-12 12:48:40 +0100
Better stats API explanation (SpiceMan)
r15559@t0mlaptop (orig r13263):  t0m | 2010-05-15 10:42:58 +0100
 r13208@spaceinvaders (orig r13172):  t0m | 2010-04-19 09:54:56 +0200
 Branch to try and fix the request uri stuff.

 r13209@spaceinvaders (orig r13173):  t0m | 2010-04-19 09:58:37 +0200
 Just add comments to tests, no functional changes
 r13210@spaceinvaders (orig r13174):  t0m | 2010-04-19 09:59:14 +0200
 Get it mostly working, except uri_for is still buggered
 r15488@spaceinvaders (orig r13192):  t0m | 2010-05-03 00:26:22 +0200
 Revert to old behaviour, allow config for new behaviour. Config option name is rubbish, needs fixing
 r15532@spaceinvaders (orig r13236):  t0m | 2010-05-09 01:09:01 +0200
 I hate this name less. Others may feel differently
 r15556@spaceinvaders (orig r13260):  t0m | 2010-05-15 10:52:16 +0200
 Simplify madness some more, back to how it looked in the original fix_path_info_decoding branch so that we aren't using dodgy heuristics to determine the path. Alter the prepare_path tests so that they're testing the appropriate config option so that we now have tests for both code paths
 r15557@spaceinvaders (orig r13261):  t0m | 2010-05-15 11:20:16 +0200
 Add a pile of docs for the new use_request_uri_for_path setting
 r15558@spaceinvaders (orig r13262):  t0m | 2010-05-15 11:38:06 +0200
 Add recommendation

r15560@t0mlaptop (orig r13264):  t0m | 2010-05-15 10:55:07 +0100
Changelog, bump versions, add new contributor :)
r15567@t0mlaptop (orig r13271):  jhannah | 2010-05-19 23:36:21 +0100
We appear to have a bug where if lazy => 1 isn't set an exception
occurs.

r15575@t0mlaptop (orig r13279):  jhannah | 2010-05-20 20:46:31 +0100
Oops. I should have TODO'd this one.  rafl++

lib/Catalyst.pm
t/lib/TestApp.pm

index 7ab8c48..26b7649 100644 (file)
@@ -2406,10 +2406,6 @@ sub setup_components {
         # we know M::P::O found a file on disk so this is safe
 
         Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } );
-
-        # Needs to be done as soon as the component is loaded, as loading a sub-component
-        # (next time round the loop) can cause us to get the wrong metaclass..
-        $class->_controller_init_base_classes($component);
     }
 
     for my $component (@comps) {
@@ -2419,7 +2415,6 @@ sub setup_components {
             : $class->expand_component_module( $component, $config );
         for my $component (@expanded_components) {
             next if $comps{$component};
-            $class->_controller_init_base_classes($component); # Also cover inner packages
             $class->components->{ $component } = $class->setup_component($component);
         }
     }
@@ -2472,19 +2467,6 @@ sub expand_component_module {
 
 =cut
 
-# FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes
-#         nearest to Catalyst::Controller first, no matter what order stuff happens
-#         to be loaded. There are TODO tests in Moose for this, see
-#         f2391d17574eff81d911b97be15ea51080500003
-sub _controller_init_base_classes {
-    my ($app_class, $component) = @_;
-    return unless $component->isa('Catalyst::Controller');
-    foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) {
-        Moose::Meta::Class->initialize( $class )
-            unless find_meta($class);
-    }
-}
-
 sub setup_component {
     my( $class, $component ) = @_;
 
index d339f6e..3bd3763 100644 (file)
@@ -44,6 +44,11 @@ our $VERSION = '0.01';
 
 TestApp->config( name => 'TestApp', root => '/some/dir', use_request_uri_for_path => 1 );
 
+# Test bug found when re-adjusting the metaclass compat code in Moose
+# in 292360. Test added to Moose in 4b760d6, but leave this attribute
+# above ->setup so we have some generated methods to be double sure.
+has an_attribute_before_we_change_base_classes => ( is => 'ro');
+
 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
     with 'CatalystX::LeakChecker';