]> git.decadent.org.uk Git - maypole.git/commitdiff
#6617 Required cols patch in CDBI.pm (Jesse Sheidlower)
authorSimon Cozens <simon@simon-cozens.org>
Mon, 21 Jun 2004 13:30:51 +0000 (13:30 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Mon, 21 Jun 2004 13:30:51 +0000 (13:30 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@154 48953598-375a-da11-a14b-00016c27c3ee

lib/Maypole/Model/CDBI.pm

index f27233a89947a25b213779e17459e4d417e39847..825d7522c09e854532bbd2972b6aa59be2e906e5 100644 (file)
@@ -36,9 +36,13 @@ sub do_edit :Exported {
     my ($obj) = @{$r->objects || []};
     if ($obj) {
         # We have something to edit
-        $obj->update_from_cgi($h);
+        $obj->update_from_cgi($h => {
+           required => $r->{config}{$r->{table}}{required_cols} || [],
+                                    });
     } else {
-        $obj = $self->create_from_cgi($h);
+        $obj = $self->create_from_cgi($h => {
+           required => $r->{config}{$r->{table}}{required_cols} || [],
+                                    });
         $creating++;
     }
     if (my %errors = $obj->cgi_update_errors) {