From 2f277c6096d3a93e2f0cd3e2b7bd1c4245398d5f Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 29 Jan 2004 17:49:54 +0000 Subject: [PATCH] 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 --- lib/Apache/MVC/Model/CDBI.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 { -- 2.39.5