--- loncom/interface/portfolio.pm	2006/08/02 16:56:30	1.143
+++ loncom/interface/portfolio.pm	2006/08/04 20:41:32	1.144
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.143 2006/08/02 16:56:30 banghart Exp $
+# $Id: portfolio.pm,v 1.144 2006/08/04 20:41:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1476,7 +1476,6 @@ sub upload {
         }
     }
     $fname=&Apache::lonnet::clean_filename($fname);
-
     my $portfolio_root=&get_portfolio_root();
     my ($uname,$udom) = &get_name_dom();
     my $port_path = &get_port_path();
@@ -1596,7 +1595,10 @@ sub createdir {
 }
 
 sub get_portfolio_root {
-    my ($uname,$udom) = &get_name_dom();
+    my ($udom,$uname) = @_;
+    if (!defined($uname) || !defined($udom)) {
+	($uname,$udom) = &get_name_dom();
+    }
     my $path;
     if (defined($env{'form.group'})) {
         $path = '/userfiles/groups/'.$env{'form.group'}.'/portfolio';