Fixed a small bug... if replace is called by SUPER, @_ == 1 if it only contains an...
authorpbowen <pbowen>
Fri, 18 Mar 2005 16:47:26 +0000 (16:47 +0000)
committerpbowen <pbowen>
Fri, 18 Mar 2005 16:47:26 +0000 (16:47 +0000)
FS/FS/Record.pm

index e24c0eb..2a78c4d 100644 (file)
@@ -845,11 +845,9 @@ returns the error, otherwise returns false.
 
 sub replace {
   my $new = shift;
+  my $old = shift;  
 
-  my $old;
-  if ( @_ ) { 
-    $old = shift;
-  } else {
+  if (!defined($old)) { 
     warn "[debug]$me replace called with no arguments; autoloading old record\n"
      if $DEBUG;
     my $primary_key = $new->dbdef_table->primary_key;