X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_svc.pm;h=08003dd42735aa4d9d074e78967496ee6fcb4866;hp=518e847a2bf75590eee0baf6cd52f4aa29edbe32;hb=8eae613f03657bd343cceb674854035ba501ecb5;hpb=d3c0497a3ecf0404777fcfa3e84da5e6cbbda96e diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 518e847a2..08003dd42 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -12,6 +12,11 @@ use FS::export_svc; use FS::cust_svc; use FS::part_svc_class; +FS::UID->install_callback(sub { + # preload the cache and make sure all modules load + my $svc_defs = FS::part_svc->_svc_defs; +}); + $DEBUG = 0; =head1 NAME @@ -649,9 +654,17 @@ sub _svc_defs { next; } $info{$mod} = $info; + + # all svc_* modules are required to have h_svc_* modules for invoice + # display. check for them as early as possible. + eval "use FS::h_$mod;"; + if ( $@ ) { + die "couldn't load history record module h_$mod: $@\n"; + } } } + tie my %svc_defs, 'Tie::IxHash', map { $_ => $info{$_}->{'fields'} } sort { $info{$a}->{'display_weight'} <=> $info{$b}->{'display_weight'} }