Merge remote-tracking branch 'upstream/master'
Charlie Garrison [Sun, 28 Sep 2014 02:52:48 +0000 (12:52 +1000)]
1  2 
lib/Catalyst.pm

diff --combined lib/Catalyst.pm
@@@ -127,7 -127,7 +127,7 @@@ __PACKAGE__->stats_class('Catalyst::Sta
  __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC);
  
  # Remember to update this in Catalyst::Runtime as well!
- our $VERSION = '5.90072';
+ our $VERSION = '5.90073';
  
  sub import {
      my ( $class, @arguments ) = @_;
@@@ -682,11 -682,6 +682,11 @@@ sub controller 
              my $comps = $c->components;
              my $check = $appclass."::Controller::".$name;
              return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
 +            foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
 +                next unless $path =~ /.*::Controller/;
 +                $check = $path."::".$name;
 +                return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
 +            }
          }
          my @result = $c->_comp_search_prefixes( $name, qw/Controller C/ );
          return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@@ -725,11 -720,6 +725,11 @@@ sub model 
              my $comps = $c->components;
              my $check = $appclass."::Model::".$name;
              return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
 +            foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
 +                next unless $path =~ /.*::Model/;
 +                $check = $path."::".$name;
 +                return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
 +            }
          }
          my @result = $c->_comp_search_prefixes( $name, qw/Model M/ );
          return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@@ -794,11 -784,6 +794,11 @@@ sub view 
              else {
                  $c->log->warn( "Attempted to use view '$check', but does not exist" );
              }
 +            foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
 +                next unless $path =~ /.*::View/;
 +                $check = $path."::".$name;
 +                return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
 +            }
          }
          my @result = $c->_comp_search_prefixes( $name, qw/View V/ );
          return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@@ -2730,7 -2715,7 +2730,7 @@@ sub locate_components 
      my $config = shift;
  
      my @paths   = qw( ::M ::Model ::V ::View ::C ::Controller );
 -    my $extra   = delete $config->{ search_extra } || [];
 +    my $extra   = $config->{ search_extra } || [];
  
      unshift @paths, @$extra;
  
@@@ -3086,6 -3071,7 +3086,7 @@@ sub _handle_unicode_decoding 
  
      return unless defined $value;
  
+     ## I think this mess is to support the old nested
      if ( ref $value eq 'ARRAY' ) {
          foreach ( @$value ) {
              $_ = $self->_handle_unicode_decoding($_);
  
  sub _handle_param_unicode_decoding {
      my ( $self, $value ) = @_;
+     return unless defined $value; # not in love with just ignoring undefs - jnap
      my $enc = $self->encoding;
      return try {
          Encode::is_utf8( $value ) ?