}
undef $obj if $creating;
+
+ die "do_update failed with error : $fatal" if ($fatal);
$r->template("edit");
} else {
$r->template("view");
}
+
+
$r->objects( $obj ? [$obj] : []);
}
};
if ($fatal = $@) {
- warn "$fatal" if $r->debug;
+ warn "FATAL ERROR: $fatal" if $r->debug;
+# $self->dbi_rollback;
+ } else {
+# $self->dbi_commit;
}
$creating++;
}
sub do_delete {
my ( $self, $r ) = @_;
+ # FIXME: handle fatal error with exception
$_->SUPER::delete for @{ $r->objects || [] };
+# $self->dbi_commit;
$r->objects( [ $self->retrieve_all ] );
$r->{template} = "list";
$self->list($r);