diff options
author | ivan <ivan> | 2009-02-24 09:50:44 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-02-24 09:50:44 +0000 |
commit | c8de2cc983d3f014deefb06f1c0b982bc0852247 (patch) | |
tree | ca9b76ccf65303a7e84623021eba5eab094aa187 | |
parent | fa1ac68bf90cb9582f239bce31db157ec2719f43 (diff) |
bootstrapping issues
-rw-r--r-- | FS/FS/part_pkg.pm | 8 | ||||
-rwxr-xr-x | FS/bin/freeside-setup | 4 | ||||
-rwxr-xr-x | bin/freeside-create-initial-data | 4 |
3 files changed, 14 insertions, 2 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index f7c56f3dd..ef24b5343 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1,7 +1,7 @@ package FS::part_pkg; use strict; -use vars qw( @ISA %plans $DEBUG ); +use vars qw( @ISA %plans $DEBUG $setup_hack ); use Carp qw(carp cluck confess); use Scalar::Util qw( blessed ); use Time::Local qw( timelocal_nocheck ); @@ -22,6 +22,7 @@ use FS::part_pkg_link; @ISA = qw( FS::m2m_Common FS::option_Common ); $DEBUG = 0; +$setup_hack = 0; =head1 NAME @@ -454,7 +455,10 @@ sub check { 'part_pkg_taxproduct', 'taxproductnum' ) - || $self->ut_agentnum_acl('agentnum', \@null_agentnum_right) + || ( $setup_hack + ? $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' ) + : $self->ut_agentnum_acl('agentnum', \@null_agentnum_right) + ) || $self->SUPER::check ; return $error if $error; diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index cc6356c7d..12d9a949c 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -3,6 +3,10 @@ #to delay loading dbdef until we're ready BEGIN { $FS::Schema::setup_hack = 1; } +#to allow initial insert +$FS::part_pkg::setup_hack = 1; +$FS::part_pkg::setup_hack = 1; + use strict; use vars qw($opt_u $opt_d $opt_v); use Getopt::Std; diff --git a/bin/freeside-create-initial-data b/bin/freeside-create-initial-data index 052f47465..38bf9a5c3 100755 --- a/bin/freeside-create-initial-data +++ b/bin/freeside-create-initial-data @@ -1,5 +1,9 @@ #!/usr/bin/perl -Tw +#to allow initial insert +$FS::part_pkg::setup_hack = 1; +$FS::part_pkg::setup_hack = 1; + use strict; use vars qw($opt_d $opt_v); use Getopt::Std; |