fix 'Can't call method "setup" on an undefined value' error when using into rates...
[freeside.git] / FS / FS / ClientAPI / MasonComponent.pm
index 2027840..37cf7ef 100644 (file)
@@ -67,15 +67,14 @@ my %session_callbacks = (
                      map  { $_->part_pkg }
                           $cust_main->ncancelled_pkgs;
 
-      warn "classnums: ". join(',', keys %classnum). "\n";
-
-      unless ( $classnum{''} ) {
+      unless ( $classnum{''} || ! keys %classnum ) {
         @part_pkg = grep $classnum{ $_->classnum }, @part_pkg;
       }
     }
 
     my %args = @$argsref;
     $args{part_pkg} = \@part_pkg;
+    $args{first_svc} = \@first_svc;
     @$argsref = ( %args );
     return ''; #no error
 
@@ -111,6 +110,7 @@ sub mason_comp {
 
   my $conf = new FS::Conf;
   $FS::Mason::Request::FSURL = $conf->config('selfservice_server-base_url');
+  $FS::Mason::Request::FSURL .= '/' unless $FS::Mason::Request::FSURL =~ /\/$/;
   $FS::Mason::Request::QUERY_STRING = $packet->{'query_string'} || '';
 
   $outbuf = '';