--- loncom/publisher/lonpublisher.pm 2003/08/21 17:07:57 1.131 +++ loncom/publisher/lonpublisher.pm 2003/09/16 22:00:25 1.133 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.131 2003/08/21 17:07:57 albertel Exp $ +# $Id: lonpublisher.pm,v 1.133 2003/09/16 22:00:25 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -974,11 +974,12 @@ sub publish { # -------------------------------------------------- Parse content for metadata if (($style eq 'ssi') || ($style eq 'prv')) { - my $oldenv=$ENV{'request.uri'}; - - $ENV{'request.uri'}=$target; - $allmeta=Apache::lonxml::xmlparse(undef,'meta',$content); - $ENV{'request.uri'}=$oldenv; + my $dir=$source; + $dir=~s-/[^/]*$--; + my $file=$source; + $file=(split('/',$file))[-1]; + $source=&Apache::lonnet::hreflocation($dir,$file); + $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); &metaeval($allmeta); } @@ -1492,6 +1493,8 @@ sub phasetwo { sub batchpublish { my ($r,$srcfile,$targetfile)=@_; + #publication pollutes %ENV with form.* values + my %oldENV=%ENV; $srcfile=~s/\/+/\//g; $targetfile=~s/\/+/\//g; my $thisdisfn=$srcfile; @@ -1527,6 +1530,7 @@ sub batchpublish { &phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); $r->print('

'); } + %ENV=%oldENV; return ''; }