|
From: Ray Z. <rz...@co...> - 2002-01-29 20:12:51
|
Hi Chris,
Here's a patch for SPOPS which fixes a problem with initialization
data passed in to clone(). The problem is that a field which has a
"true" value in the original object cannot be set to a false value by
a hash passed to clone().
--- SPOPS-0.56/SPOPS.pm Sun Jan 13 22:12:15 2002
+++ SPOPS-0.56-patched/SPOPS.pm Tue Jan 29 14:37:51 2002
@@ -183,7 +183,7 @@
while ( my ( $k, $v ) = each %{ $self } ) {
next unless ( $k );
next if ( $id_field and $k eq $id_field );
- $initial_data{ $k } = $p->{ $k } || $v;
+ $initial_data{ $k } = exists $p->{ $k } ? $p->{ $k } : $v;
}
return $class->new({ %initial_data, skip_default_values => 1 });
--
Ray Zimmerman / e-mail: rz...@co... / 428-B Phillips Hall
Sr Research / phone: (607) 255-9645 / Cornell University
Associate / FAX: (815) 377-3932 / Ithaca, NY 14853
|