]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/TT.pm
Miscellaneous fixes.
[maypole.git] / lib / Maypole / View / TT.pm
index 3c2e05fef0f209fd4a772894f1f065890ff4a727..47999a4692460dc5137c53bbdd8e3d3dd5e223e7 100644 (file)
@@ -12,7 +12,6 @@ sub new { bless {}, shift } # Not worth having
 sub _tt {
     my ($self, $r) = @_;
     my $root = $r->{ar}->document_root . "/". $r->{ar}->location;
-    warn "Root was $root";
     Template->new({ INCLUDE_PATH => [
         $root,
         ($r->model_class && File::Spec->catdir($root, $r->model_class->moniker)),
@@ -34,7 +33,7 @@ sub _args {
     if ($class) { 
         $args{classmetadata} = {
             name => $class,
-            columns => [ $class->columns ],
+            columns => [ $class->display_columns ],
             colnames => { $class->column_names },
             related_accessors => [ $class->related($r) ],
             moniker => $class->moniker,
@@ -47,7 +46,7 @@ sub _args {
         if (@{$r->objects || []} > 1) { 
             $args{$r->model_class->plural_moniker} = $r->objects;
         } else {
-            ($args{$r->model_class->moniker}) = @{$r->objects};
+            ($args{$r->model_class->moniker}) = @{$r->objects ||[]};
         }
     }