bootstrapping issues
authorivan <ivan>
Tue, 24 Feb 2009 09:50:44 +0000 (09:50 +0000)
committerivan <ivan>
Tue, 24 Feb 2009 09:50:44 +0000 (09:50 +0000)
FS/FS/part_pkg.pm
FS/bin/freeside-setup
bin/freeside-create-initial-data

index f7c56f3..ef24b53 100644 (file)
@@ -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;
index cc6356c..12d9a94 100755 (executable)
@@ -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;
index 052f474..38bf9a5 100755 (executable)
@@ -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;