From: Simon Cozens Date: Mon, 21 Jun 2004 13:30:51 +0000 (+0000) Subject: #6617 Required cols patch in CDBI.pm (Jesse Sheidlower) X-Git-Tag: 2.10~208 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=9497b573512cd3348e5cdebb2cc07f77f3dc06b4;p=maypole.git #6617 Required cols patch in CDBI.pm (Jesse Sheidlower) git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@154 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index f27233a..825d752 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -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) {