]> git.decadent.org.uk Git - maypole.git/commitdiff
Whoa, oops, carry object over. This stops it being recreated every time.
authorSimon Cozens <simon@simon-cozens.org>
Thu, 29 Jan 2004 17:49:54 +0000 (17:49 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 29 Jan 2004 17:49:54 +0000 (17:49 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@20 48953598-375a-da11-a14b-00016c27c3ee

lib/Apache/MVC/Model/CDBI.pm

index 86b2d344c23f93d284a4d53336fb6eddef0d3ab9..8e0b9812bd1763cd1ddb5ed3e8f373a2f06a2866 100644 (file)
@@ -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 {