On Wed, May 06, 2009 at 10:09:17AM +0100, Chisel Wright wrote:
> OK, I should be able to pick this up tonight. I'll drop a patch here
> when I'm done.

I've attached three patches:

 - one for the TestApp/Component/* issue
 - one for Formbuilder::Action (it's not happy with
   Class::Accessor::Fast)
 - one for View::HTML::Template to deal with the Catalyst::Base warning

All the tests pass against Catalyst-Controller-FormBuilder-0.04 with
Catalyst-5.80003.

I consciously stayed clear of Moosifying anything (e.g. _mk_accessors)
in the hope that the module still works with 5.7.

Chisel
-- 
Chisel Wright
e: chi...@herlpacker.co.uk
w: http://www.herlpacker.co.uk/

  Please wait a moment while Windows prepares to start for the first time..
diff -Naur t-orig/lib/TestApp/Component/HTML/Template.pm t/lib/TestApp/Component/HTML/Template.pm
--- t-orig/lib/TestApp/Component/HTML/Template.pm	2009-05-06 18:28:43.000000000 +0100
+++ t/lib/TestApp/Component/HTML/Template.pm	2009-05-06 18:35:26.000000000 +0100
@@ -3,17 +3,25 @@
 use strict;
 use base 'Catalyst::View::HTML::Template';
 
+use Class::C3;
+
 sub new {
     my $self = shift;
+
+    # force stringification, Moose validation only accepts a Str
+    my $path = TestApp->path_to( 'root', 'src', 'tmpl' ) . q{};
+
     $self->config(
         {
             die_on_bad_params => 0,
-            path              => [
-                TestApp->path_to( 'root', 'src', 'tmpl' ),
-            ],
+            path              => $path,
         },
     );
-    return $self->NEXT::new(@_);
+    
+    return $self = $self->next::method(@_)
+        if $self->next::can;
+
+    return $self;
 }
 
 1;
diff -Naur t-orig/lib/TestApp/Component/Mason.pm t/lib/TestApp/Component/Mason.pm
--- t-orig/lib/TestApp/Component/Mason.pm	2009-05-06 18:28:43.000000000 +0100
+++ t/lib/TestApp/Component/Mason.pm	2009-05-06 18:35:59.000000000 +0100
@@ -3,13 +3,18 @@
 use strict;
 use base 'Catalyst::View::Mason';
 
+use Class::C3;
+
 sub new {
     my $self = shift;
 
     my $comp_root = TestApp->path_to( 'root', 'src', 'mason' );
     $self->config->{comp_root} = "$comp_root";
 
-    return $self->NEXT::new(@_);
+    return $self = $self->next::method(@_)
+        if $self->next::can;
+
+    return $self;
 }
 
 1;
diff -Naur t-orig/lib/TestApp/Component/TT.pm t/lib/TestApp/Component/TT.pm
--- t-orig/lib/TestApp/Component/TT.pm	2009-05-06 18:28:43.000000000 +0100
+++ t/lib/TestApp/Component/TT.pm	2009-05-06 18:30:11.000000000 +0100
@@ -3,6 +3,8 @@
 use strict;
 use base 'Catalyst::View::TT';
 
+use Class::C3;
+
 sub new {
     my $self = shift;
     $self->config(
@@ -16,7 +18,11 @@
             TIMER              => 0,
         }
     );
-    return $self->NEXT::new(@_);
+    
+    return $self = $self->next::method(@_)
+        if $self->next::can;
+
+    return $self;
 }
 
 1;
diff -Naur lib-orig/Catalyst/Controller/FormBuilder/Action.pm lib/Catalyst/Controller/FormBuilder/Action.pm
--- lib-orig/Catalyst/Controller/FormBuilder/Action.pm	2009-05-06 18:52:21.000000000 +0100
+++ lib/Catalyst/Controller/FormBuilder/Action.pm	2009-05-06 19:01:23.000000000 +0100
@@ -5,10 +5,10 @@
 use CGI::FormBuilder::Source::File;
 use File::Spec;
 use Class::Inspector;
-use NEXT;
+use Class::C3;
 use Scalar::Util ();
 
-use base qw/Catalyst::Action Class::Accessor::Fast Class::Data::Inheritable/;
+use base qw/Catalyst::Action Class::Accessor Class::Data::Inheritable/;
 
 __PACKAGE__->mk_classdata(qw/_source_class/);
 __PACKAGE__->mk_accessors(qw/_attr_params _source_type/);
@@ -126,7 +126,7 @@
     my $self = shift;
     my ( $controller, $c ) = @_;
 
-    return $self->NEXT::execute(@_)
+    return $self->next::method(@_)
       unless exists $self->attributes->{ActionClass}
       && $self->attributes->{ActionClass}[0] eq
       $controller->_fb_setup->{action};
@@ -134,7 +134,7 @@
     my $form = $self->_setup_form(@_);
     Scalar::Util::weaken($form->{c});
     $controller->_formbuilder($form);
-    $self->NEXT::execute(@_);
+    $self->next::method(@_);
     $controller->_formbuilder($form);   # keep the same form in case of forwards
 
     $self->setup_template_vars( @_ );
--- Catalyst/View/HTML/Template.pm.orig	2009-05-06 18:39:08.000000000 +0100
+++ Catalyst/View/HTML/Template.pm	2009-05-06 18:39:46.000000000 +0100
@@ -1,7 +1,7 @@
 package Catalyst::View::HTML::Template;
 
 use strict;
-use base 'Catalyst::Base';
+use base 'Catalyst::Controller';
 
 use HTML::Template;
 
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to