summaryrefslogtreecommitdiff
path: root/FS/FS/h_svc_www.pm
diff options
context:
space:
mode:
authorkhoff <khoff>2005-04-01 22:52:11 +0000
committerkhoff <khoff>2005-04-01 22:52:11 +0000
commit29c80b06fd677d43ff94d4503bb577107c71882e (patch)
tree9ae1084150e5a15712a51db67400146f17feeb7e /FS/FS/h_svc_www.pm
parent40861f48bd2987133783f6b086adb1988f9872be (diff)
Trap, and attempt to resolve, problems caused by missing history records.
Diffstat (limited to 'FS/FS/h_svc_www.pm')
-rw-r--r--FS/FS/h_svc_www.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/FS/FS/h_svc_www.pm b/FS/FS/h_svc_www.pm
index 30ec366..7931061 100644
--- a/FS/FS/h_svc_www.pm
+++ b/FS/FS/h_svc_www.pm
@@ -1,7 +1,8 @@
package FS::h_svc_www;
use strict;
-use vars qw( @ISA );
+use vars qw( @ISA $DEBUG );
+use Carp qw(carp);
use FS::Record qw(qsearchs);
use FS::h_Common;
use FS::svc_www;
@@ -9,6 +10,8 @@ use FS::h_domain_record;
@ISA = qw( FS::h_Common FS::svc_www );
+$DEBUG = 0;
+
sub table { 'h_svc_www' };
=head1 NAME
@@ -27,10 +30,21 @@ FS::h_svc_www - Historical web virtual host objects
sub domain_record {
my $self = shift;
- qsearchs( 'h_domain_record',
- { 'recnum' => $self->recnum },
- FS::h_domain_record->sql_h_searchs(@_),
- );
+
+ carp 'Called FS::h_svc_www->domain_record on svcnum ' . $self->svcnum if $DEBUG;
+
+ my $domain_record = qsearchs(
+ 'h_domain_record',
+ { 'recnum' => $self->recnum },
+ FS::h_domain_record->sql_h_searchs(@_),
+ ) || $self->SUPER::domain_record
+ or die "no history domain_record.recnum for svc_www.recnum ". $self->domsvc;
+
+ carp 'Using FS::svc_acct record in place of missing FS::h_svc_acct record.'
+ if ($domain_record->isa('FS::domain_record') and $DEBUG);
+
+ return $domain_record;
+
}
=back