[freeside-commits] freeside/FS/FS svc_Common.pm,1.50,1.51

Ivan,,, ivan at wavetail.420.am
Tue Aug 4 15:04:53 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv29148/FS

Modified Files:
	svc_Common.pm 
Log Message:
ignore problams calling ->overlimit during sqlradius-reset, wtf?!  RT#5868 

Index: svc_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_Common.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- svc_Common.pm	23 Mar 2009 17:03:03 -0000	1.50
+++ svc_Common.pm	4 Aug 2009 22:04:51 -0000	1.51
@@ -1,8 +1,9 @@
 package FS::svc_Common;
 
 use strict;
-use vars qw( @ISA $noexport_hack $DEBUG $me );
-use Carp qw( cluck carp croak ); #specify cluck have to specify them all..
+use vars qw( @ISA $noexport_hack $DEBUG $me
+             $overlimit_missing_cust_svc_nonfatal_kludge );
+use Carp qw( cluck carp croak confess ); #specify cluck have to specify them all
 use Scalar::Util qw( blessed );
 use FS::Record qw( qsearch qsearchs fields dbh );
 use FS::cust_main_Mixin;
@@ -18,6 +19,8 @@
 $me = '[FS::svc_Common]';
 $DEBUG = 0;
 
+$overlimit_missing_cust_svc_nonfatal_kludge = 0;
+
 =head1 NAME
 
 FS::svc_Common - Object method for all svc_ records
@@ -798,7 +801,19 @@
 
 sub overlimit {
   my $self = shift;
-  $self->cust_svc->overlimit(@_);
+  #$self->cust_svc->overlimit(@_);
+  my $cust_svc = $self->cust_svc;
+  unless ( $cust_svc ) { #wtf?
+    my $error = "$me overlimit: missing cust_svc record for svc_acct svcnum ".
+                $self->svcnum;
+    if ( $overlimit_missing_cust_svc_nonfatal_kludge ) {
+      cluck "$error; continuing anyway as requested";
+      return '';
+    } else {
+      confess $error;
+    }
+  }
+  $cust_svc->overlimit(@_);
 }
 
 =item cancel



More information about the freeside-commits mailing list