[freeside-commits] freeside/FS/FS option_Common.pm,1.6,1.7

Ivan,,, ivan at wavetail.420.am
Tue Jan 30 11:45:54 PST 2007


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv10018

Modified Files:
	option_Common.pm 
Log Message:
fix old-record detection bug in option_Common

Index: option_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/option_Common.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- option_Common.pm	29 Jan 2007 11:55:38 -0000	1.6
+++ option_Common.pm	30 Jan 2007 19:45:51 -0000	1.7
@@ -2,6 +2,7 @@
 
 use strict;
 use vars qw( @ISA $DEBUG );
+use Scalar::Util qw( blessed );
 use FS::Record qw( qsearch qsearchs dbh );
 
 @ISA = qw( FS::Record );
@@ -161,7 +162,7 @@
 sub replace {
   my $self = shift;
 
-  my $old = ( ref($_[0]) eq ref($self) )
+  my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
               ? shift
               : $self->replace_old;
 
@@ -169,6 +170,7 @@
     ( ref($_[0]) eq 'HASH' )
       ? shift
       : { @_ };
+
   warn "FS::option_Common::replace called on $self with options ".
        join(', ', map "$_ => ". $options->{$_}, keys %$options)
     if $DEBUG;



More information about the freeside-commits mailing list