]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/CDBI.pm
database_setup fix applied
[maypole.git] / lib / Maypole / Model / CDBI.pm
index 4ed0aa68b331179ace9c43f7ec516c9338a2759a..8904a425321f9ed4780fcf076426087bc5c79c5c 100644 (file)
@@ -119,7 +119,9 @@ sub do_edit : Exported {
                     { required => $r->{config}{ $r->{table} }{required_cols} || [], }
             );
         };
-        $fatal = $@;
+        if ($fatal = $@) {
+            warn "$fatal" if $r->debug;
+        }
         $creating++;
     }
     if ( my %errors = $fatal ? (FATAL => $fatal) : $obj->cgi_update_errors ) {
@@ -134,7 +136,7 @@ sub do_edit : Exported {
     else {
         $r->{template} = "view";
     }
-    $r->objects( [$obj] );
+    $r->objects( $obj ? [$obj] : []);
 }
 
 sub delete : Exported {
@@ -234,7 +236,7 @@ sub setup_database {
             dsn       => $dsn,
             user      => $u,
             password  => $p,
-            options   => $opts,
+           %$opts,
         )
     );
     $config->{classes} = [ $config->{loader}->classes ];