diff options
author | Mark Wells <mark@freeside.biz> | 2016-01-11 12:20:08 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-01-11 13:00:48 -0800 |
commit | 6474ef2745c16c49edd014e93f7a1e80bd2001d9 (patch) | |
tree | 8b2f67739a981d909d701c7503b6b044b21d3c2b /FS/FS/part_svc.pm | |
parent | f9dbc2068c8ef9402b9c7a418e7589c20e4e6cfa (diff) |
add safety check for existence of h_svc_* modules, #39779, #34107, #22009, #15902, #11454, #7322, #7111
Diffstat (limited to 'FS/FS/part_svc.pm')
-rw-r--r-- | FS/FS/part_svc.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 518e847..08003dd 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'} } |