From: Simon Cozens Date: Thu, 29 Jan 2004 17:49:54 +0000 (+0000) Subject: Whoa, oops, carry object over. This stops it being recreated every time. X-Git-Tag: 2.10~342 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=2f277c6096d3a93e2f0cd3e2b7bd1c4245398d5f;p=maypole.git Whoa, oops, carry object over. This stops it being recreated every time. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@20 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Apache/MVC/Model/CDBI.pm b/lib/Apache/MVC/Model/CDBI.pm index 86b2d34..8e0b981 100644 --- a/lib/Apache/MVC/Model/CDBI.pm +++ b/lib/Apache/MVC/Model/CDBI.pm @@ -16,10 +16,9 @@ sub get_objects { sub do_edit :Exported { my ($self, $r) = @_; my $h = CGI::Untaint->new(%{$r->{params}}); - my $obj; - if (@{$r->{args}}) { + my ($obj) = @{$self->objects}; + if ($obj) { # We have something to edit - ($obj) = @{$self->objects}; $obj->update_from_cgi($h); warn "Updating an object ($obj) with ".Dumper($h); use Data::Dumper; } else {