r22767@hercule (orig r1158): mateu | 2009-07-28 14:16:29 +0100
[catagits/Reaction.git] / lib / Reaction / UI / Skin.pm
index e5233cf..aff773c 100644 (file)
@@ -7,6 +7,7 @@ use Reaction::UI::LayoutSet;
 use Reaction::UI::RenderingContext;
 use File::ShareDir;
 use File::Basename;
+use Config::Any;
 
 use aliased 'Path::Class::Dir';
 
@@ -20,7 +21,7 @@ has 'name' => (is => 'ro', isa => 'Str', required => 1);
 has 'skin_dir' => (is => 'rw', isa => Dir, lazy_fail => 1);
 
 has 'widget_search_path' => (
-  is => 'rw', isa => 'ArrayRef', requred => 1, default => sub { [] }
+  is => 'rw', isa => 'ArrayRef', required => 1, default => sub { [] }
 );
 
 has 'view' => (
@@ -92,10 +93,15 @@ sub _load_skin_config {
   }
   if (exists $cfg{widget_search_path}) {
     $self->widget_search_path($lst->($cfg{widget_search_path}));
-  } else {
+  }
+  # For some reason this conditional doesn't work correctly without
+  # the "my @x". Answers on a postcard.
+  unless (my @x = $self->full_widget_search_path) {
     confess "No widget_search_path in defaults.conf or skin.conf"
-            ." and no search path provided from super skin"
-      unless $self->full_widget_search_path;
+            .($self->has_super
+              ? " and no search path provided from super skin "
+                .$self->super->name
+              : "");
   }
 }
 sub create_layout_set {